#arc115e. [arc115_e]LEQ and NEQ
[arc115_e]LEQ and NEQ
Problem Statement
Given is a sequence of integers . Print the number, modulo , of sequences of integers satisfying all of the following conditions:
Constraints
Input
Input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
3
2 3 2
Sample Output 1
6
The following six sequences satisfy all of the conditions.
Sample Input 2
10
158260522 877914575 602436426 24979445 861648772 623690081 433933447 476190629 262703497 211047202
Sample Output 2
524691026