#agc060d. [agc060_d]Same Descent Set
[agc060_d]Same Descent Set
Problem Statement
Find the number of pairs $(P,Q)=((P_1,P_2,\\cdots,P_N),(Q_1,Q_2,\\cdots,Q_N))$ of permutations of that satisfy the following condition, modulo .
- For every (), one of the two conditions below holds.
- and .
- and .
Constraints
- All numbers in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print the answer.
Sample Input 1
2
Sample Output 1
2
Two pairs, and , satisfy the condition.
Sample Input 2
3
Sample Output 2
10
Sample Input 3
4
Sample Output 3
88
Sample Input 4
10
Sample Output 4
286574791