#include <bits/stdc++.h>
using namespace std;
long long ksm(long long a, long long b) {
  if (!b) return 1;
  long long ns = ksm(a, b >> 1);
  ns = ns * ns % 1000000007;
  if (b & 1) ns = ns * a % 1000000007;
  return ns;
}
struct edge {
  int u, v;
  edge *next;
} p[3005 * 2], *h[3005];
int egcnt = 0;
void addedge(int u, int v) {
  edge *n1 = &p[egcnt++];
  n1->u = u, n1->v = v, n1->next = h[u], h[u] = n1;
}
long long bk[3005];
int size[3005];
long long dp[3005][3005];
void dfs(int a) {
  size[a] = 1;
  dp[a][0] = 0;
  for (edge *p = h[a]; p; p = p->next) dfs(p->v), size[a] += size[p->v];
  for (int i = 1; i < 3005; i++) {
    dp[a][i] = dp[a][i - 1];
    long long ns = 1;
    for (edge *p = h[a]; p; p = p->next) ns = ns * dp[p->v][i] % 1000000007;
    dp[a][i] += ns, dp[a][i] %= 1000000007;
  }
}
long long jc[3005], bjc[3005];
long long c1(int a, int b) {
  if (b > a) return 0;
  long long ans = jc[a] * bjc[b] % 1000000007 * bjc[a - b] % 1000000007;
  return ans;
}
long long c(long long a, long long b) {
  long long ns = 1;
  for (int i = 1; i <= b; i++)
    ns = ns * bk[i] % 1000000007, ns = ns * (a - i + 1) % 1000000007;
  return ns;
}
int n, d;
int main() {
  scanf("%d%d", &n, &d);
  jc[0] = bjc[0] = 1;
  for (int i = 1; i <= n; i++)
    bk[i] = ksm(i, 1000000007 - 2), jc[i] = jc[i - 1] * i % 1000000007,
    bjc[i] = bjc[i - 1] * bk[i] % 1000000007;
  for (int i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    addedge(p, i);
  }
  dfs(1);
  long long ans = 0;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= i - 1; j++)
      dp[1][i] -= dp[1][j] * c1(i, j), dp[1][i] %= 1000000007;
  for (int i = 1; i <= n && i <= d; i++)
    ans = ans + c(d, i) * (dp[1][i]) % 1000000007, ans %= 1000000007;
  if (ans < 0) ans += 1000000007;
  printf("%lld\n", ans);
  return 0;
}
