#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Read(T &n) {
  char ch;
  bool flag = false;
  while (!isdigit(ch = getchar()))
    if (ch == '-') flag = true;
  for (n = ch ^ 48; isdigit(ch = getchar());
       n = (n << 1) + (n << 3) + (ch ^ 48))
    ;
  if (flag) n = -n;
}
const int MOD = 1000000007;
const int MAXN = 100005;
inline int inc(int a, int b) {
  assert(a >= 0 and a < MOD and b >= 0 and b < MOD);
  a += b;
  if (a >= MOD) a -= MOD;
  return a;
}
inline int dec(int a, int b) {
  assert(a >= 0 and a < MOD and b >= 0 and b < MOD);
  a -= b;
  if (a < 0) a += MOD;
  return a;
}
struct _ {
  int nxt, to;
  _(int nxt = 0, int to = 0) : nxt(nxt), to(to) {}
} edge[MAXN << 1];
int fst[MAXN], tot;
inline void Add_Edge(int f, int t) {
  edge[++tot] = _(fst[f], t);
  fst[f] = tot;
}
int f[MAXN][2], fa[MAXN];
int n;
void dfs(int x) {
  f[x][1] = 1;
  f[x][0] = 0;
  int S = 1, S0 = 1, S1 = 0;
  for (register int u = fst[x]; u; u = edge[u].nxt) {
    int v = edge[u].to;
    dfs(v);
    int tmp1 = f[x][0], tmp2 = f[x][1];
    f[x][0] = inc(1ll * tmp1 * (f[v][0] + 1) % MOD, 1ll * tmp2 * f[v][1] % MOD);
    f[x][1] = inc(1ll * tmp1 * f[v][1] % MOD, 1ll * tmp2 * (f[v][0] + 1) % MOD);
    S = 1ll * S * (f[v][0] + 1) % MOD;
    tmp1 = S0, tmp2 = S1;
    S0 = inc(tmp1, 1ll * tmp2 * f[v][1] % MOD);
    S1 = inc(tmp2, 1ll * tmp1 * f[v][1] % MOD);
  }
  f[x][1] = dec(inc(f[x][1], f[x][1]), S);
  f[x][0] = dec(inc(f[x][0], f[x][0]), S1);
}
int main() {
  int T = 1;
  while (T--) {
    Read(n);
    for (register int i = 2; i <= n; i++) Read(fa[i]), Add_Edge(fa[i], i);
    dfs(1);
    printf("%d\n", inc(f[1][0], f[1][1]));
  }
  return 0;
}
