#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v[100002];
long long int dp[100002][2][2];
bool use[100002][2][2];
inline long long int dfs(int a, int b, int c) {
  if (use[a][b][c]) {
    return dp[a][b][c];
  }
  if (v[a].size() == 0) {
    use[a][b][c] = true;
    if (b == c) {
      return 0;
    }
    dp[a][b][c] = 1;
    return 1;
  }
  use[a][b][c] = true;
  int S = v[a].size();
  long long int way[] = {0, 0};
  long long int nex_way[] = {0, 0};
  way[b ^ true] = 1;
  for (int i = 0; i < S; i++) {
    nex_way[0] = nex_way[1] = 0;
    for (int j = 0; j < 2; j++) {
      if (way[j]) {
        for (int k = 0; k < 2; k++) {
          nex_way[k] += dfs(v[a][i], j, k) * way[j];
          if (nex_way[k] >= 1000000007LL) {
            nex_way[k] %= 1000000007LL;
          }
        }
      }
    }
    way[0] += nex_way[0];
    way[1] += nex_way[1];
    if (way[0] >= 1000000007LL) {
      way[0] %= 1000000007LL;
    }
    if (way[1] >= 1000000007LL) {
      way[1] %= 1000000007LL;
    }
  }
  dp[a][b][c] += way[c];
  if (dp[a][b][c] >= 1000000007LL) {
    dp[a][b][c] %= 1000000007LL;
  }
  way[0] = way[1] = 0;
  way[b ^ true] = 1;
  for (int i = S - 1; i >= 0; i--) {
    nex_way[0] = nex_way[1] = 0;
    for (int j = 0; j < 2; j++) {
      if (way[j]) {
        for (int k = 0; k < 2; k++) {
          nex_way[k] += dfs(v[a][i], j, k) * way[j];
          if (nex_way[k] >= 1000000007LL) {
            nex_way[k] %= 1000000007LL;
          }
        }
      }
    }
    way[0] += nex_way[0];
    way[1] += nex_way[1];
    if (way[0] >= 1000000007LL) {
      way[0] %= 1000000007LL;
    }
    if (way[1] >= 1000000007LL) {
      way[1] %= 1000000007LL;
    }
  }
  dp[a][b][c] += way[c];
  if (dp[a][b][c] >= 1000000007LL) {
    dp[a][b][c] %= 1000000007LL;
  }
  int be = b ^ true;
  int en = c;
  way[0] = way[1] = 0;
  long long int des = 0;
  if (b ^ true == c) {
    long long int sum = 0;
    for (int i = 0; i < S; i++) {
      sum += (sum + 1LL) * dfs(v[a][i], c, c);
      if (sum >= 1000000007LL) {
        sum %= 1000000007LL;
      }
    }
    des = sum;
  } else {
    int fact = b ^ true;
    int fact2 = c;
    long long int way2[] = {0, 0};
    for (int i = 0; i < S; i++) {
      long long int tmp1 = (way2[1] + 1LL) * dfs(v[a][i], fact, fact2);
      long long int tmp2 = way2[0] * dfs(v[a][i], fact2, fact);
      way2[1] += tmp2;
      way2[0] += tmp1;
      if (way2[0] >= 1000000007LL) {
        way2[0] %= 1000000007LL;
      }
      if (way2[1] >= 1000000007LL) {
        way2[1] %= 1000000007LL;
      }
    }
    des = way2[0];
  }
  if (des >= 1000000007LL) {
    des %= 1000000007LL;
  }
  dp[a][b][c] += 1000000007LL - des;
  if (b ^ true == c) {
    dp[a][b][c] += 1000000007LL - 1;
  }
  if (dp[a][b][c] >= 1000000007LL) {
    dp[a][b][c] %= 1000000007LL;
  }
  return dp[a][b][c];
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    p--;
    v[p].push_back(i - 1);
  }
  long long int ans = dfs(0, 0, 0) + dfs(0, 0, 1);
  if (ans >= 1000000007LL) {
    ans %= 1000000007LL;
  }
  printf("%I64d\n", ans);
  return 0;
}
