Arpas family consists of $$n$$ men. We can show them with a rooted tree with $$n$$ vertices. Arpa wants to choose $$k$$ of them for playing football but he shouldn't choose someone and his brother too. In short, there should be no direct siblings, both selected for playing football. Print in how many ways he can choose this set modulo $$10^9+7$$.
Input Format
The first line contains two integers, n, k (\(1 \leq n \leq 10^5, 0 \leq k \leq 100\)).
The second line contains $$n-1$$ integers \(p_2, p_3, \ldots, p_n\) (\(p_i < i\)) -- $$p_i$$ is the index of the parent of $$i$$-th person.
Output Format
Print in how many ways he can choose this set modulo $$10^9+7$$.
Please login to use the editor
You need to be logged in to access the code editor
Loading...
Please wait while we load the editor
Login to unlock the editorial