#include <bits/stdc++.h>
using namespace std;
template <class T>
T gi() {
  T x = 0;
  bool f = 0;
  char c = getchar();
  while (c != '-' && (c < '0' || c > '9')) c = getchar();
  if (c == '-') f = 1, c = getchar();
  while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
  return f ? -x : x;
}
const int N = 3010, Mod = 1e9 + 7;
int f[N][N];
struct node {
  int to, nxt;
} g[N];
int lst[N], gl, n, D;
void add(int x, int y) {
  g[++gl] = (node){y, lst[x]};
  lst[x] = gl;
}
void dfs(int u) {
  for (int j = 1; j <= min(n, D); j++) f[u][j] = 1;
  for (int i = lst[u]; i; i = g[i].nxt) {
    int v = g[i].to;
    dfs(v);
    for (int j = 1; j <= min(n, D); j++)
      f[u][j] = 1ll * f[u][j] * f[v][j] % Mod;
  }
  for (int j = 1; j <= min(n, D); j++) f[u][j] = (f[u][j - 1] + f[u][j]) % Mod;
}
int fpow(int a, int b) {
  int res = 1;
  for (; b; b >>= 1, a = 1ll * a * a % Mod)
    if (b & 1) res = 1ll * res * a % Mod;
  return res;
}
int work() {
  int res = 0, t1 = 1, t2 = 1, t3 = 1;
  for (int i = 0; i <= n; i++) t1 = 1ll * t1 * (D - i) % Mod;
  for (int i = 1; i <= n; i++) t3 = 1ll * t3 * (Mod - i) % Mod;
  for (int i = 0; i <= n; i++) {
    (res += 1ll * f[1][i] * t1 % Mod * fpow(D - i, Mod - 2) % Mod *
            fpow(1ll * t2 * t3 % Mod, Mod - 2) % Mod) %= Mod;
    t2 = 1ll * t2 * (i + 1) % Mod;
    t3 = 1ll * t3 * fpow(Mod - n + i, Mod - 2) % Mod;
  }
  return res;
}
int main() {
  n = gi<int>(), D = gi<int>();
  for (int i = 2; i <= n; i++) add(gi<int>(), i);
  dfs(1);
  if (D <= n)
    printf("%d\n", f[1][D]);
  else
    printf("%d\n", work());
  return 0;
}
