#include <bits/stdc++.h>
using namespace std;
const int N = 3000 + 10;
const long long mod = 1e9 + 7;
const long long inf = 1e18 + 10;
long long dp[N][N], C[N][N], inv[N], n;
vector<int> adj[N];
long long Pow(long long a, long long b) {
  long long res = 1;
  for (; b; b = b >> 1) res = res * (b & 1 ? a : 1) % mod, a = a * a % mod;
  return res;
}
void dfs(int v) {
  for (int u : adj[v]) {
    dfs(u);
    for (int j = 1; j <= n; j++) dp[v][j] = dp[v][j] * dp[u][j] % mod;
  }
  for (int j = 1; j <= n; j++) dp[v][j] = (dp[v][j - 1] + dp[v][j]) % mod;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long d;
  cin >> n >> d;
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    adj[p].push_back(i);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) dp[i][j] = 1;
  dfs(1);
  for (int i = 0; i <= n; i++) {
    C[i][0] = C[i][i] = 1;
    for (int j = 1; j < i; j++) C[i][j] = (C[i - 1][j] + C[i - 1][j - 1]) % mod;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j < i; j++)
      dp[1][i] = (dp[1][i] - dp[1][j] * C[i][j]) % mod;
  inv[0] = 1;
  for (int i = 1; i < N; i++) inv[i] = inv[i - 1] * Pow(i, mod - 2) % mod;
  long long ans = 0;
  for (int i = 1; i <= n; i++) {
    long long c = inv[i];
    for (long long j = d; d - i < j; j--) c = c * j % mod;
    ans = (ans + dp[1][i] * c) % mod;
  }
  ans = (ans + mod) % mod;
  cout << ans;
  return 0;
}
