#include <bits/stdc++.h>
using namespace std;
inline int Pow(int x, int y, int mod) {
  long long t = x, r = 1;
  for (; y; y >>= 1, t = t * t % mod) y& 1 ? r = r * t % mod : 0;
  return r;
}
inline int Get() {
  int res = 0, q = 1;
  char ch = getchar();
  while ((ch < '0' || ch > '9') && ch != '-') ch = getchar();
  if (ch == '-') q = -1, ch = getchar();
  while (ch >= '0' && ch <= '9') res = res * 10 + ch - '0', ch = getchar();
  return res * q;
}
const double eps = 1e-12, pi = M_PI;
const int oo = (int)2.1e9, mod = (int)1e9 + 7;
const long long INF = (long long)1e17;
const int N = (int)1e5;
typedef int arr[N + 10];
int n, m, tot, k;
int dp[N + 10][2][2];
vector<int> son[N + 10];
void Dp(int x) {
  for (int i = (0), end = (((int)son[x].size()) - 1); i <= end; ++i)
    Dp(son[x][i]);
  if (!((int)son[x].size())) {
    dp[x][0][1] = dp[x][1][0] = 1;
    return;
  }
  int c00 = 0, c11 = 0, c10 = 1, c01 = 1, q00 = 1, q11 = 1;
  for (int i = (0), end = (((int)son[x].size()) - 1); i <= end; ++i) {
    int k = son[x][i], t00 = 0, t01 = 0, t10 = 0, t11 = 0;
    t00 = ((c00 + (long long)c00 * (long long)dp[k][0][0] % mod) % mod +
           (long long)c01 * (long long)dp[k][1][0] % mod) %
          mod;
    t01 = ((c01 + (long long)c00 * (long long)dp[k][0][1] % mod) % mod +
           (long long)c01 * (long long)dp[k][1][1] % mod) %
          mod;
    t10 = ((c10 + (long long)c10 * (long long)dp[k][0][0] % mod) % mod +
           (long long)c11 * (long long)dp[k][1][0] % mod) %
          mod;
    t11 = ((c11 + (long long)c10 * (long long)dp[k][0][1] % mod) % mod +
           (long long)c11 * (long long)dp[k][1][1] % mod) %
          mod;
    c00 = t00, c01 = t01, c10 = t10, c11 = t11,
    q00 = (long long)q00 * (long long)(1 + dp[k][0][0]) % mod,
    q11 = (long long)q11 * (long long)(1 + dp[k][1][1]) % mod;
  }
  dp[x][0][0] = c00, dp[x][0][1] = c01, dp[x][1][0] = c10, dp[x][1][1] = c11;
  c00 = c11 = 0, c10 = c01 = 1;
  for (int i = (((int)son[x].size()) - 1), end = (0); i >= end; --i) {
    int k = son[x][i], t00 = 0, t01 = 0, t10 = 0, t11 = 0;
    t00 = ((c00 + (long long)c00 * (long long)dp[k][0][0] % mod) % mod +
           (long long)c01 * (long long)dp[k][1][0] % mod) %
          mod;
    t01 = ((c01 + (long long)c00 * (long long)dp[k][0][1] % mod) % mod +
           (long long)c01 * (long long)dp[k][1][1] % mod) %
          mod;
    t10 = ((c10 + (long long)c10 * (long long)dp[k][0][0] % mod) % mod +
           (long long)c11 * (long long)dp[k][1][0] % mod) %
          mod;
    t11 = ((c11 + (long long)c10 * (long long)dp[k][0][1] % mod) % mod +
           (long long)c11 * (long long)dp[k][1][1] % mod) %
          mod;
    c00 = t00, c01 = t01, c10 = t10, c11 = t11;
  }
  (dp[x][0][0] += c00) %= mod, (dp[x][0][1] += c01) %= mod,
      (dp[x][1][0] += c10) %= mod, (dp[x][1][1] += c11) %= mod;
  int f00 = 0, f01 = 1, f10 = 1, f11 = 0;
  for (int i = (0), end = (((int)son[x].size()) - 1); i <= end; ++i) {
    int k = son[x][i], t00 = 0, t01 = 0, t10 = 0, t11 = 0;
    t00 = (f00 + (long long)f01 * (long long)dp[k][0][1] % mod) % mod;
    t01 = (f01 + (long long)f00 * (long long)dp[k][1][0] % mod) % mod;
    t10 = (f10 + (long long)f11 * (long long)dp[k][0][1] % mod) % mod;
    t11 = (f11 + (long long)f10 * (long long)dp[k][1][0] % mod) % mod;
    f00 = t00, f01 = t01, f10 = t10, f11 = t11;
  }
  ((dp[x][0][0] -= f00) += mod) %= mod;
  ((dp[x][1][1] -= f11) += mod) %= mod;
  ((dp[x][0][1] -= q11) += mod) %= mod;
  ((dp[x][1][0] -= q00) += mod) %= mod;
}
int main() {
  scanf(
      "%d"
      "\n",
      &n);
  for (int i = (2), end = (n); i <= end; ++i)
    scanf("%d", &k), son[k].push_back(i);
  Dp(1);
  printf(
      "%d"
      "\n",
      (dp[1][0][0] + dp[1][0][1]) % mod);
  return 0;
}
