There are mountains in a row, numbered from left to right. The height of mountain is .
King Dadas chooses exactly distinct mountains and installs one relay station on each chosen mountain.
Suppose and relay stations are installed on mountains and . The two relay stations can communicate directly if
If and are adjacent positions, their relay stations can always communicate directly.
Construct an undirected graph whose vertices are the installed relay stations and whose edges connect pairs that can communicate directly. Every pair of relay stations must be able to exchange information through at most edges. Equivalently, the graph must be connected and have diameter at most . The diameter of a graph with one vertex is defined as .
Count the valid ways to install the relay stations. Two ways are different if their sets of chosen mountains are different.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
Output
For each test case, print the number of valid installations modulo on one line.
Constraints
- .
- .
- .
- ().
- The sum of over all test cases does not exceed .