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$$$.
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 one number — the number of crazy arrangements of weights on the edges by modulo $$$998\,244\,353$$$.
3 31 21 22 31 3
2
4 41 1 11 22 33 41 4
3
4 21 2 31 23 4
6