Allen, having graduated from the MOO Institute of Techcowlogy (MIT), has started a startup! Allen is the president of his startup. He also hires n-1 other employees, each of which is assigned a direct superior. If u is a superior of v and v is a superior of w then also u is a superior of w. Additionally, there are no u and v such that u is the superior of v and v is the superior of u. Allen himself has no superior. Allen is employee number 1, and the others are employee numbers 2 through n.

Finally, Allen must assign salaries to each employee in the company including himself. Due to budget constraints, each employee's salary is an integer between 1 and D. Additionally, no employee can make strictly more than his superior.

Help Allen find the number of ways to assign salaries. As this number may be large, output it modulo 10^9 + 7.

Input

The first line of the input contains two integers n and D (1 ≤ n ≤ 3000, 1 ≤ D ≤ 10^9).

The remaining n-1 lines each contain a single positive integer, where the i-th line contains the integer p_i (1 ≤ p_i ≤ i). p_i denotes the direct superior of employee i+1.

Output

Output a single integer: the number of ways to assign salaries modulo 10^9 + 7.

Examples

Input

3 2
1
1


Output

5


Input

3 3
1
2


Output

10


Input

2 5
1


Output

15

Note

In the first sample case, employee 2 and 3 report directly to Allen. The three salaries, in order, can be (1,1,1), (2,1,1), (2,1,2), (2,2,1) or (2,2,2).

In the second sample case, employee 2 reports to Allen and employee 3 reports to employee 2. In order, the possible salaries are (1,1,1), (2,1,1), (2,2,1), (2,2,2), (3,1,1), (3,2,1), (3,2,2), (3,3,1), (3,3,2), (3,3,3).
#include <bits/stdc++.h>
using namespace std;
int n, d;
long long dp[3006][3006], c[3006][3006], tmp = 1, ans = 0;
const long long mod = 1e9 + 7;
vector<int> e[3006];
int dfs(int u, int p = 0) {
  for (int i = 1; i <= n; i++) dp[u][i] = 1;
  for (int i = 0; i < e[u].size(); i++) {
    int v = e[u][i];
    dfs(v, u);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 0; j < e[u].size(); j++) {
      int v = e[u][j];
      if (v == p) continue;
      dp[u][i] = (dp[u][i] * dp[v][i]) % mod;
    }
  for (int i = 1; i <= n; i++) dp[u][i] = (dp[u][i] + dp[u][i - 1]) % mod;
  return 0;
}
int init_com() {
  for (int i = 0; i < 3006; i++) c[i][0] = 1;
  for (int i = 1; i < 3006; i++)
    for (int j = 1; j <= i; j++)
      c[i][j] = (c[i - 1][j] + c[i - 1][j - 1]) % mod;
  return 0;
}
long long fast_pow(long long x, long long y) {
  if (y == 1) return x;
  if (y == 0) return 1;
  long long res = fast_pow(x, y / 2);
  if (y % 2) return ((res * res) % mod) * x % mod;
  return res * res % mod;
}
long long inv(long long x) { return fast_pow(x, mod - 2); }
int main() {
  init_com();
  cin >> n >> d;
  for (int i = 2; i <= n; i++) {
    int x;
    cin >> x;
    e[x].push_back(i);
  }
  memset(dp, 0, sizeof(dp));
  dfs(1);
  if (d <= n) return cout << dp[1][d], 0;
  for (int i = 1; i <= min(n, d); i++) {
    tmp = (tmp * (d - i + 1)) % mod;
    tmp = (tmp * inv(i)) % mod;
    for (int j = i - 1; j >= 1; j--) {
      long long dec = c[i][j];
      dec = (dec * dp[1][j]) % mod;
      dp[1][i] = (dp[1][i] - dec + mod) % mod;
    }
    ans = (ans + dp[1][i] * tmp % mod) % mod;
  }
  cout << ans;
}
