#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const int N = 1e5 + 7;
int parent[N];
vector<int> child[N];
bitset<100007> vis;
int dp[N][2];
int subM(long long a, long long b) {
  a -= b;
  if (a < 0) {
    return a + MOD;
  }
  return a >= MOD ? a - MOD : a;
}
int addM(long long a, long long b) {
  a += b;
  return a >= MOD ? a - MOD : a;
}
int mulM(long long a, long long b) {
  a *= b;
  return a >= MOD ? a % MOD : a;
}
void callList(const vector<int>& childList, int ans[2]) {
  int sum[2] = {0, 1};
  for (auto i : childList) {
    int tmpSum[2] = {0};
    tmpSum[0] = addM(mulM(sum[0], dp[i][0]), mulM(sum[1], dp[i][1]));
    tmpSum[1] = addM(mulM(sum[0], dp[i][1]), mulM(sum[1], dp[i][0]));
    sum[0] = addM(sum[0], tmpSum[0]);
    sum[1] = addM(sum[1], tmpSum[1]);
  }
  ans[0] = addM(ans[0], sum[0]);
  ans[1] = addM(ans[1], sum[1]);
}
void call(int v) {
  if (vis.test(v)) {
    return;
  }
  vis.set(v, true);
  vector<int> tmpList;
  for (auto i : child[v]) {
    tmpList.push_back(i);
    call(i);
  }
  callList(tmpList, dp[v]);
  reverse(tmpList.begin(), tmpList.end());
  callList(tmpList, dp[v]);
  int sub[2][2] = {{0, 0}, {1, 1}};
  for (auto i : tmpList) {
    int tmpSub[2][2] = {0};
    for (int j = 0; j < 2; ++j) {
      for (int k = 0; k < 2; ++k) {
        tmpSub[1 ^ j][k ^ 1] =
            addM(tmpSub[1 ^ j][1 ^ k], mulM(sub[k][j], dp[i][1 ^ k ^ j]));
      }
    }
    for (int j = 0; j < 2; ++j) {
      for (int k = 0; k < 2; ++k) {
        sub[j][k] = addM(sub[j][k], tmpSub[j][k]);
      }
    }
  }
  dp[v][0] = subM(dp[v][0], sub[0][0]);
  dp[v][1] = subM(dp[v][1], sub[1][0]);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; ++i) {
    int p;
    scanf("%d", &p);
    parent[i] = p - 1;
    child[p - 1].push_back(i);
  }
  call(0);
  printf("%d", addM(dp[0][0], dp[0][1]));
  return 0;
}
