The first line contains two integers $n$ and $k$ ($3 \le n \le 10^6$, $1 \le k \le \min(n, 2000)$)~--- the number of floors in the building and the number of tasks.

The second line contains $k$ integers $x_1$, $x_2$, $\ldots$, $x_k$ ($1 \le x_i \le n$)~--- the floors on which Sasha will solve the tasks. It is guaranteed that all $x_i$ are distinct.

The third line contains $n-1$ integers $p_2$, $p_3$, $\ldots$, $p_n$ ($1 \le p_i < i$), where $p_i$ describes the number of the floor to which the staircase leads down from floor $i$.