You are given an array of length . Your task is to find the number of permutations of length from which you can construct the given array using the following rule:
Since the answer could be a large number, you need to compute it modulo .
A permutation is a sequence of integers from to of length containing each number exactly once. For example, are permutations and are not.
Input format
Output format
For each test case, print the number of permutations of length from which you can construct the given array . Since the answer could be very large, print it modulo .
Constraints
For test case : No permutation satisfies the condition. Hence, the answer is .
For test case : The only permutation will be . Hence, the answer is .