You are given an undirected tree with $$$n$$$ nodes, numbered from $$$1$$$ to $$$n$$$. Each node $$$i$$$ on the tree has a weight $$$p_i$$$. It is guaranteed that the weights $$$p_1, p_2, \dots, p_n$$$ form a permutation.
For a connected component on the tree (that is, a connected subgraph consisting of some nodes of the tree and the edges between them), we define its MEX value as the smallest non-negative integer that does not appear in the set of node weights within this connected component.
Now there are $$$q$$$ queries. Each query gives two integers $$$A$$$ and $$$B$$$. For each query, you need to determine how many connected components in the tree satisfy both of the following conditions:
Since the number of connected components satisfying the conditions may be very large, output the answer to each query modulo $$$10^9 + 7$$$.
The input contains multiple test cases.
The first line contains an integer $$$t$$$ ($$$1 \le t \le 10^4$$$), denoting the number of test cases.
For each test case, the first line contains two integers $$$n, q$$$ ($$$1 \le n, q \le 2 \cdot 10^5$$$).
The second line contains $$$n$$$ integers $$$p_1, p_2, \dots, p_n$$$ ($$$0 \le p_i \lt n$$$). It is guaranteed that these numbers form a permutation of $$$0$$$ to $$$n-1$$$.
The next $$$n - 1$$$ lines each contain two integers $$$u, v$$$ ($$$1 \le u, v \le n$$$), representing an edge in the tree.
The following $$$q$$$ lines each contain two integers $$$A, B$$$ ($$$1 \le A \le n, 0 \le B \le n$$$), representing a query.
It is guaranteed that for each test file, the sum of all $$$n$$$ and the sum of all $$$q$$$ over all test cases do not exceed $$$2 \cdot 10^5$$$, respectively.
For each test case, output $$$q$$$ lines. Each line should contain one integer, representing the answer to the corresponding query modulo $$$10^9 + 7$$$.
15 52 0 1 3 41 22 33 43 52 04 14 21 32 4
0 0 2 2 1
In the first sample:
| Name |
|---|


