Problem: Let's call a sequence of integers MEX-correct if for all () holds. Where is the minimum non-negative integer that doesn't belong to the set . For example, and .
You are given an array consisting of non-negative integers. Calculate the number of non-empty MEX-correct subsequences of a given array. The number of subsequences can be very large, so print it modulo .
Note: a subsequence of an array is a sequence meeting the constraints . If two different ways to choose the sequence of indices yield the same subsequence, the resulting subsequence should be counted twice (i. e. two subsequences are different if their sequences of indices are not the same).
Input Format: The first line contains a single integer () — the number of test cases.
The first line of each test case contains a single integer ().
The second line contains integers ().
The sum of over all test cases doesn't exceed .
Output Format: For each test case, print a single integer — the number of non-empty MEX-correct subsequences of a given array, taken modulo .
Note: In the first example, the valid subsequences are , , and .
In the second example, the valid subsequences are and .
In the third example, any non-empty subsequence is valid.