#agc036f. [agc036_f]Square Constraints
[agc036_f]Square Constraints
Problem Statement
Given is an integer . How many permutations of satisfy the following condition?
- For each , holds.
Since the number can be enormous, compute it modulo .
Constraints
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of permutations that satisfy the condition, modulo .
Sample Input 1
2 998244353
Sample Output 1
4
Four permutations satisfy the condition:
Sample Input 2
10 998244353
Sample Output 2
53999264
Sample Input 3
200 998244353
Sample Output 3
112633322