Bowling is a sport in which a player rolls a bowling ball towards a group of pins, the target being to knock down the pins at the end of a lane. In this challenge, the rules of the game are slightly modified. Now, there are n number of pins, n is even, and the pins are arranged in a horizontal line instead of a triangular formation. ith pin has number arr[i] on it. In each throw you have to knock down exactly two consecutive pins. Once you knock down pins at positions i and i+1, those present at i-1 and i+2 will become adjacent. And you'll get arr[i-1]*arr[i]*arr[i+1]*arr[i+2] points for knocking ith and i+1th pins down. If i-1 or i+2 goes out of bounds, assume that there is a pin with number 1 on it at that position.
Find out the maximum number of points one can get when played wisely. Since the answer can be large, return answer modulo 1e9 + 7 as output.
Input: An array of length n - numbers on the pins
Output: Single integer