Problem: You are given an array , where all elements are distinct.
You can perform several (possibly zero) operations with it. In one operation, you can choose a contiguous subsegment of and remove all elements from that subsegment, except for the minimum element on that subsegment. For example, if and you choose the subsegment from the -rd element to the -th element, the resulting array is .
An array is called reachable if it can be obtained from using several (maybe zero) aforementioned operations. Calculate the number of reachable arrays, and print it modulo .
Input Format: The first line of the input contains one integer () — the number of test cases.
Each test case consists of two lines. The first line contains one integer (). The second line contains distinct integers ().
Additional constraint on the input: the sum of over all test cases does not exceed .
Output Format: For each test case, print one integer — the number of reachable arrays, taken modulo .