#abc178c. [abc178_c]Ubiquity
[abc178_c]Ubiquity
Problem Statement
How many integer sequences of length satisfy all of the following conditions?
- There exists some such that holds.
- There exists some such that holds.
The answer can be very large, so output it modulo .
Constraints
- is an integer.
Input
Input is given from Standard Input in the following format:
Output
Print the answer modulo .
Sample Input 1
2
Sample Output 1
2
Two sequences and satisfy all conditions.
Sample Input 2
1
Sample Output 2
0
Sample Input 3
869121
Sample Output 3
2511445