#include <bits/stdc++.h>
const int SIZE = 1 << 20;
char buf[SIZE], *p1, *p2;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, SIZE, stdin);
  return p1 == p2 ? EOF : *p1++;
}
template <typename T>
void read(T &x) {
  x = 0;
  char c = gc();
  while (!isdigit(c)) c = gc();
  while (isdigit(c)) (x *= 10) += c ^ 48, c = gc();
}
const int MOD = 1e9 + 7;
inline int add(int a, int b) { return (a += b - MOD) + (a >> 31 & MOD); }
inline int sub(int a, int b) { return (a -= b) + (a >> 31 & MOD); }
inline int mul(int a, int b) { return 1LL * a * b % MOD; }
const int N = 1e5;
int n;
std::vector<int> adj[N + 1];
int dp[N + 1][2];
void dfs(int u) {
  dp[u][0] = 0, dp[u][1] = 1;
  if (adj[u].size() == 0) return;
  for (int i = 0; i < adj[u].size(); ++i) {
    int v = adj[u][i];
    dfs(v);
    int temp0 = dp[u][0], temp1 = dp[u][1];
    dp[u][0] = add(dp[u][0], add(mul(temp0, dp[v][0]), mul(temp1, dp[v][1])));
    dp[u][1] = add(dp[u][1], add(mul(temp0, dp[v][1]), mul(temp1, dp[v][0])));
  }
  dp[u][0] = mul(dp[u][0], 2);
  dp[u][1] = mul(dp[u][1], 2);
  int a = 1, b = 1, c = 0;
  for (int i = 0; i < adj[u].size(); ++i) {
    int v = adj[u][i];
    a = add(a, mul(a, dp[v][0]));
    int temp_b = b, temp_c = c;
    b = add(b, mul(temp_c, dp[v][1]));
    c = add(c, mul(temp_b, dp[v][1]));
  }
  dp[u][0] = sub(dp[u][0], c);
  dp[u][1] = sub(dp[u][1], a);
}
void work() {
  read(n);
  for (int i = 1; i <= n; ++i) adj[i].clear();
  for (int i = 2; i <= n; ++i) {
    int fa;
    read(fa);
    adj[fa].push_back(i);
  }
  dfs(1);
  printf("%d\n", add(dp[1][0], dp[1][1]));
}
int main() {
  work();
  return 0;
}
