I am the danger. A guy opens his door and gets shot, and you think that of me? No. I am the one who knocks!
- Walter White, Breaking Bad
It's well-known that Walter is the one who knocks. But did you know that he can knock with strength for every positive integer ?
He has an array of positive integers. If he knocks with strength , then, for each , will be replaced with .
How many different arrays can Walter achieve by knocking any number of times? As the number can be very large, output it modulo .
Here denotes the remainder of when dividing by . For example, , and .
Input data
The first line of the input contains a single integer () - the length of the array.
The second line of the input contains integers () - the elements of the array.
Output data
Output a single integer - the number of different arrays Walt can achieve by knocking.
Example 1
stdin
1
5
stdout
4
Explanation
In the first sample, you can get the following arrays: .
Example 2
stdin
2
6 5
stdout
7
Explanation
In the second sample, you can get the following arrays: .
Example 3
stdin
5
1 2 4 8 16
stdout
69