#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100010;
const int MOD = 1e9 + 7;
inline int add(int a, int b) { return (a += b) >= MOD ? a - MOD : a; }
inline int sub(int a, int b) { return (a -= b) < 0 ? a + MOD : a; }
inline int mul(int a, int b) { return 1ll * a * b % MOD; }
int n;
vector<int> e[MAXN];
int f[MAXN][2];
void dfs(int u, int fa) {
  f[u][0] = f[u][1] = 0;
  for (int i = 0; i < (int)e[u].size(); i++)
    if (e[u][i] != fa) dfs(e[u][i], u);
  sort(e[u].begin(), e[u].end());
  int g[2][2];
  g[0][0] = 1;
  g[0][1] = g[1][0] = g[1][1] = 0;
  int j = 1;
  for (int i = 0; i < (int)e[u].size(); i++, j ^= 1) {
    int v = e[u][i];
    if (v == fa) continue;
    g[j][0] = add(mul(g[j ^ 1][0], f[v][0] + 1), mul(g[j ^ 1][1], f[v][1]));
    g[j][1] = add(mul(g[j ^ 1][1], f[v][0] + 1), mul(g[j ^ 1][0], f[v][1]));
  }
  for (int k = 0; k < 2; k++) f[u][k] = mul(g[j ^ 1][k ^ 1], 2);
  g[0][0] = 1;
  g[0][1] = g[1][0] = g[1][1] = 0;
  j = 1;
  for (int i = 0; i < (int)e[u].size(); i++, j ^= 1) {
    int v = e[u][i];
    if (v == fa) continue;
    g[j][0] = add(g[j ^ 1][0], mul(g[j ^ 1][1], f[v][1]));
    g[j][1] = add(g[j ^ 1][1], mul(g[j ^ 1][0], f[v][1]));
  }
  f[u][0] = sub(f[u][0], g[j ^ 1][1]);
  int now = 1;
  for (int i = 0; i < (int)e[u].size(); i++, j ^= 1) {
    int v = e[u][i];
    if (v == fa) continue;
    now = mul(now, f[v][0] + 1);
  }
  f[u][1] = sub(f[u][1], now);
}
inline void reset() {
  for (int i = 1; i <= n; i++) e[i].clear();
}
inline void work() {
  scanf("%d", &n);
  reset();
  for (int i = 2, x; i <= n; i++) scanf("%d", &x), e[x].push_back(i);
  dfs(1, 0);
  printf("%d\n", add(f[1][0], f[1][1]));
}
int main() {
  int T;
  T = 1;
  while (T--) work();
  return 0;
}
