Today is Rajaee's birthday!! $$$Who$$$ $$$Asked?$$$
Sadly, no one remembered his birthday, so he decided to make a birthday cake by himself. He went searching in the kitchen for suitable ingredients, but unfortunately, he found nothing but an array of positive integer numbers. He is going to make a cake out of this array using the following technique:
Rajaee is wondering in how many ways he can divide the array into smaller subarrays such that he can make a cake out of it. Rajaee is too bad at maths so he needs your help to know the number of ways modulo $$$10^9 + 7$$$.
Two ways are considered different if there exists an element with index $$$i$$$ belonging to two different subarrays in each way.
The first line contains a single integer number $$$N$$$ $$$(3 \le N \le 10^6)$$$, the size of the array.
The second line contains $$$N$$$ integer numbers $$$a_1, a_2,.., a_N$$$ $$$(1 \le a_i \le 10^9)$$$, the elements of the array.
Output the number of ways modulo $$$10^9 + 7$$$.
33 4 5
1
61 5 2 4 1 2
18
107 2 3 5 8 3 1 9 4 5
436
| Name |
|---|


