#include <bits/stdc++.h>
using namespace std;
const long long maxn = 3e3 + 7;
const long long mod = 1e9 + 7;
const long long INF = 1e9 + 7;
const long long mlog = 20;
const long long SQ = 400;
long long fact[maxn];
long long inv[maxn];
vector<long long> adj[maxn];
long long dp[maxn][maxn];
long long n, D;
long long f[maxn];
long long pow(long long a, long long b) {
  if (!b) return 1;
  if (b & 1) return a * pow(a * a % mod, b / 2) % mod;
  return pow(a * a % mod, b / 2);
}
long long C(long long n, long long r) {
  if (r < 0 || r > n) return 0;
  if (n < maxn) return ((inv[r] * inv[n - r]) % mod * fact[n]) % mod;
  long long res = inv[r];
  for (long long i = n; i > n - r; i--) res = (res * i) % mod;
  return res;
}
void prep() {
  fact[0] = 1;
  for (long long i = 1; i < maxn; i++) fact[i] = (fact[i - 1] * i) % mod;
  inv[maxn - 1] = pow(fact[maxn - 1], mod - 2);
  for (long long i = maxn - 1; i > 0; i--) inv[i - 1] = (inv[i] * i) % mod;
}
void dfs(long long v) {
  for (long long i = 1; i <= n; i++) dp[v][i] = 1;
  for (long long u : adj[v]) {
    dfs(u);
    for (long long i = 1; i <= n; i++) dp[v][i] = dp[v][i] * dp[u][i] % mod;
  }
  for (long long i = 2; i <= n; i++) dp[v][i] = (dp[v][i] + dp[v][i - 1]) % mod;
}
int32_t main() {
  ios_base::sync_with_stdio(false), cin.tie(), cout.tie();
  ;
  prep();
  cin >> n >> D;
  for (long long i = 2; i <= n; i++) {
    long long p;
    cin >> p;
    adj[p].push_back(i);
  }
  dfs(1);
  for (long long i = 1; i <= n; i++) f[i] = dp[1][i];
  for (long long i = 1; i <= n; i++)
    for (long long j = 1; j < i; j++) f[i] = (f[i] - C(i, j) * f[j]) % mod;
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
    ans = ((ans + f[i] * C(D, i)) % mod + mod) % mod;
  cout << ans << "\n";
  return 0;
}
