G. Crazy Arrangements
time limit per test
2 seconds
memory limit per test
512 megabytes
input
standard input
output
standard output

You have a tree where $$$m$$$ simple paths are chosen: $$$(u_1, v_1)$$$, $$$(u_2, v_2)$$$, $$$\ldots$$$, $$$(u_m, v_m)$$$ — each path is determined by two vertices $$$u_i$$$ and $$$v_i$$$, the start and the end. All paths have non-zero length, meaning $$$u_i \neq v_i$$$.

Some jokester wants to assign weights to edges each being either $$$0$$$ or $$$1$$$. Let's consider $$$s_i$$$ a sum of all weights of the edges along the $$$i$$$-th path modulo $$$2$$$ (in other words, xor of all weights along this path). The jokester calls an arrangement of weights on the edges crazy if the following inequality is correct: $$$s_{i} \le s_{i+1}$$$ for all $$$1 \le i \lt m$$$.

Your task is to calculate the number of crazy arrangements of weighs. Because the arrangements are crazy, you have to find the answer by modulo $$$998\,244\,353$$$.

Input

The first line contains two integers $$$n$$$ and $$$m$$$ — the number of vertices in the tree and the number of chosen paths ($$$2 \le n, m \le 250\,000$$$).

The second line contains $$$n - 1$$$ integers $$$p_i$$$ denoting that there is an edge in the tree connecting the vertices $$$p_i$$$ and $$$i + 1$$$ ($$$1 \le p_i \lt i + 1$$$).

The next $$$m$$$ lines contain two integers $$$u_i$$$ and $$$v_i$$$ each — the start and the end of the $$$i$$$-th path ($$$1 \leq u_i \lt v_i \leq n$$$).

Output

Output one number — the number of crazy arrangements of weights on the edges by modulo $$$998\,244\,353$$$.

Examples
Input
3 3
1 2
1 2
2 3
1 3
Output
2
Input
4 4
1 1 1
1 2
2 3
3 4
1 4
Output
3
Input
4 2
1 2 3
1 2
3 4
Output
6