#include <bits/stdc++.h>
using namespace std;
template <class _Tp>
_Tp gcd(_Tp a, _Tp b) {
  return (b == 0) ? (a) : (gcd(b, a % b));
}
const long long Inf = 1000000000000000000ll;
const int inf = 1000000000;
char buf[1 << 25], *p1 = buf, *p2 = buf;
inline int getc() {
  return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 25, stdin), p1 == p2)
             ? EOF
             : *p1++;
}
inline int read() {
  int x = 0, f = 0;
  char c = getc();
  while (!isdigit(c)) (c == '-') && (f = 1), c = getc();
  while (isdigit(c)) x = x * 10 + (c & 15), c = getc();
  return f ? -x : x;
}
const long long mod = 1000000007;
int qpow(int b, int p) {
  int res = 1;
  while (p) {
    if (p & 1) res = 1ll * res * b % mod;
    b = 1ll * b * b % mod;
    p >>= 1;
  }
  return res;
}
void upt(int& x, int y) {
  if (y < 0) y += mod;
  (x += y) >= mod && (x -= mod);
}
const int N = 3005;
int n, d, fa[N], f[N][N];
int main() {
  n = read();
  d = read();
  for (int i = 2; i <= n; ++i) fa[i] = read();
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n + 1; ++j) {
      f[i][j] = 1;
    }
  }
  for (int i = n; i >= 1; --i) {
    for (int j = 2; j <= n + 1; ++j) upt(f[i][j], f[i][j - 1]);
    if (i > 1)
      for (int j = 1; j <= n + 1; ++j)
        f[fa[i]][j] = 1ll * f[fa[i]][j] * f[i][j] % mod;
  }
  for (int i = 2; i <= n + 1; ++i)
    for (int j = 1; j <= n - i + 2; ++j)
      f[i][j] = (f[i - 1][j + 1] - f[i - 1][j] + mod) % mod;
  int ans = 0, C = 1;
  for (int i = 1; i <= n + 1 && i <= d; ++i) {
    upt(ans, 1ll * C * f[i][1] % mod);
    C = 1ll * C * (d - i) % mod * qpow(i, mod - 2) % mod;
  }
  printf("%d\n", ans);
  return 0;
}
