Consider a permutation containing each integer from to exactly once. Count the permutations satisfying
Print the answer modulo .
Input
The input is given in the following format:
case case case
Each test case is given in the following format:
Output
For each test case, print the number of valid permutations modulo on one line.
Constraints
- .
- .
- .
- The sum of over all test cases does not exceed .
Subtasks
Samples
입력
2
3 1 2 2
5 2 5 3
출력
2
0