#P9049. [PA 2021] Mopadulo
[PA 2021] Mopadulo
Problem Description
Given a sequence of length , find how many ways there are to divide into several intervals, such that for every interval, the sum of all numbers in this interval modulo is even.
Since the answer may be very large, you only need to output the value of the answer modulo .
Input Format
The first line contains an integer .
The second line contains integers .
Output Format
One line containing an integer, representing the required value.
4
1000000006 1 5 1000000004
3
Hint
Sample #1 Explanation
The three ways to divide are as follows.
Constraints
For all testdata, , .
Translated by ChatGPT 5