George dreamt about an unusual permutation .
A permutation is considered unusual if, for each element , exactly one of the following conditions is true:
For example, , and are unusual, while and are not.
Unfortunately, after waking up, George remembers only some of the elements from . As such, he now wonders how many unusual permutations containing the remaining numbers exist.
Since the answer can be very large, George only wants to know its remainder modulo .
Input
Each test contains multiple test cases. The first line of input contains a single integer () — the number of testcases.
The first line of each test case contains a single integer () — the number of elements in the permutation.
The second line of each test case contains integers (). If , then George forgot the value of . Otherwise, George knows that must be equal to . It is guaranteed that there are no two indices for which .
It is guaranteed that the sum of across all testcases does not exceed .
Output
For each test case, output a single integer, denoting the number of unusual permutations containing the remaining numbers. Since the answer can be very large, print its remainder modulo .
Example
stdin
4
4
2 0 0 4
3
3 1 2
5
0 0 0 4 0
1
0
stdout
2
0
4
1
Note
In the first testcase, there are two possible permutations: and , both of which are unusual.
In the second testcase, the only possible permutation is , which is not unusual.
In the third testcase, the unusual permutations are , , and .
In the fourth testcase, the only possible permutation is , which is unusual.