Problem: You are given an array consisting of integers.
You have to perform the sequence of operations on this array:
- during the first operation, you either add to and subtract from , or add to and subtract from ;
- during the second operation, you either add to and subtract from , or add to and subtract from ;
- ...
- during the last operation, you either add to and subtract from , or add to and subtract from .
So, during the -th operation, you add the value of to one of its neighbors, and subtract it from the other neighbor.
For example, if you have the array , one of the possible sequences of operations is:
- subtract from and add it to , so the array becomes ;
- subtract from and add it to , so the array becomes ;
- subtract from and add it to , so the array becomes .
So, the resulting array is .
An array is reachable if it can be obtained by performing the aforementioned sequence of operations on . You have to calculate the number of reachable arrays, and print it modulo .
Input Format: The first line contains one integer ().
The second line contains integers ().
Output Format: Print one integer — the number of reachable arrays. Since the answer can be very large, print its remainder modulo .