#include <bits/stdc++.h>
int fa[3000 + 5], f[3000 + 5][3000 + 5], c[3000 + 5][3000 + 5], r[3000 + 5];
int main() {
  int n, d, i, j, s, ans = 0;
  scanf("%d%d", &n, &d);
  for (i = 2; i <= n; ++i) scanf("%d", &fa[i]);
  for (i = 1; i <= n; ++i)
    for (j = 1; j <= n; ++j) f[i][j] = 1;
  for (i = n; i; --i)
    for (s = 0, j = 1; j <= n; ++j)
      f[i][j] = (f[i][j] + f[i][j - 1]) % 1000000007,
      f[fa[i]][j] = 1LL * f[fa[i]][j] * f[i][j] % 1000000007;
  for (i = 0; i <= n; ++i)
    for (c[i][0] = j = 1; j <= i; ++j)
      c[i][j] = (c[i - 1][j - 1] + c[i - 1][j]) % 1000000007;
  for (i = 1; i <= n; ++i)
    for (j = 1; j < i; ++j)
      f[1][i] = (f[1][i] + 1000000007 - 1LL * c[i][j] * f[1][j] % 1000000007) %
                1000000007;
  for (r[1] = 1, i = 2; i <= n; ++i)
    r[i] = 1LL * (1000000007 - 1000000007 / i) * r[1000000007 % i] % 1000000007;
  for (i = s = 1; i <= n && i <= d; ++i)
    s = 1LL * s * (d - i + 1) % 1000000007 * r[i] % 1000000007,
    ans = (ans + 1LL * f[1][i] * s) % 1000000007;
  printf("%d", ans);
}
