#include <bits/stdc++.h>
using namespace std;
int read() {
  int X = 0, w = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') w = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') X = X * 10 + c - '0', c = getchar();
  return X * w;
}
const int N = 3000 + 10;
const int mod = 1e9 + 7;
int qpow(int a, int b) {
  int c = 1;
  for (; b; b >>= 1, a = 1ll * a * a % mod)
    if (b & 1) c = 1ll * c * a % mod;
  return c;
}
int n, D, dp[N][N];
struct edge {
  int v, nxt;
} e[N];
int head[N];
void addEdge(int u, int v) {
  static int cnt = 0;
  e[++cnt] = (edge){v, head[u]}, head[u] = cnt;
}
void dfs(int u) {
  for (int i = 1; i <= n; ++i) dp[u][i] = 1;
  for (int i = head[u]; i; i = e[i].nxt) {
    int v = e[i].v;
    dfs(v);
    for (int j = 1; j <= n; ++j) dp[u][j] = 1ll * dp[u][j] * dp[v][j] % mod;
  }
  for (int i = 1; i <= n; ++i) dp[u][i] = (dp[u][i] + dp[u][i - 1]) % mod;
}
int calc(int x) {
  if (x <= n) return dp[1][x];
  int s = 1, res = 0, o = n & 1 ? mod - 1 : 1;
  for (int i = 1; i <= n; ++i)
    s = 1ll * s * (x - i) % mod * qpow(i, mod - 2) % mod;
  for (int i = 0; i <= n; ++i, o = mod - o) {
    res = (res + 1ll * dp[1][i] * o % mod * s) % mod;
    s = 1ll * s * (x - i) % mod * qpow(x - i - 1, mod - 2) % mod *
        qpow(i + 1, mod - 2) % mod * (n - i) % mod;
  }
  return res;
}
int main() {
  n = read(), D = read();
  for (int i = 2; i <= n; ++i) addEdge(read(), i);
  dfs(1);
  printf("%d\n", calc(D));
  return 0;
}
