Task
A permutation of order is called a mountain permutation if and only if for every , , with even, the condition holds. If , only the condition needs to hold.
For example, the permutation of order 5 is a mountain permutation because and , but the permutation of order 5 is not a mountain permutation because , so for the condition is not satisfied.
A permutation of order is a sequence of elements that contains all elements from to in any order. For example, the sequence is a permutation of order , but the sequences and are not permutations of order .
Given a number , find the number of mountain permutations of order , . Since the answer can be very large, only the remainder of the answer divided by another given number is requested.
Input data
The first line contains the natural numbers , representing the order number for which you need to find the permutations, and , the modulo for the answer.
Output data
The first line contains the result modulo .
Constraints and clarifications
- is prime
# | Points | Constraints |
---|---|---|
1 | 11 | |
2 | 13 | |
3 | 17 | |
4 | 59 | No additional constraints |
Example
stdin
5 19
stdout
6
Explanation
The number of mountain permutations of order is . Two of these permutations are and .