The Admirals were surprised to find that very few retrofits were implemented in 2019.
Investigations revealed that the head of the retrofit factory, Yuuri, had withheld blueprints intended for other ship girls. In the first month of 2020, she used these blueprints to perform magnificent retrofits, resulting in three forms: Yuuri Kai Ni, Yuuri Kai Ni Toku, and Yuuri Kai Ni Tei. With capabilities for anti-air, anti-ground, anti-submarine, opening torpedo strikes, and five equipment slots, she became capable of anything. The naval base's 80,000 steel reserves were tragically depleted.
A ship girl's structure can be viewed as a tree with $n$ nodes, labeled $0 \sim n-1$. Using one blueprint, one can remove an edge from the tree and add a new edge such that the resulting structure remains a tree.
Now, Yuuri wants to continue taking other ship girls' blueprints in 2020 to retrofit herself, and she has taken a total of $k$ blueprints. She wants to know how many different forms she can have after these retrofits. Two forms are considered different if there exists an edge $(x, y)$ that appears in one tree but not in the other.
Input
The first line contains two integers $n$ and $k$, representing the number of nodes in the tree and the number of blueprints, respectively.
The second line contains $n-1$ integers $f_i$, describing the structure of the tree, where the parent of node $i$ is $f_i$.
Output
Output a single integer representing the answer, modulo $998244353$.
Examples
Input 1
3 1 0 0
Output 1
3
Input 2
4 1 0 1 2
Output 2
8
Input 3
6 1 0 1 2 2 0
Output 3
28
Note
For all data, $1 \le n \le 50$ and $0 \le k \le n$.
For 20% of the data, $k = 0$. (Test case 1 has $k = 0$).
For 20% of the data (test cases 1–4), $f_i = 0$.
For 30% of the data (test cases 1–6), $n \le 5$.