#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, p = 1e9 + 7;
int T, n, fst[N], nxt[N], to[N], m;
long long f[N][2];
void dfs(int u) {
  f[u][1] = 1;
  f[u][0] = 0;
  long long s11 = 0, s12 = 0, s2 = 1;
  for (int i = fst[u]; i; i = nxt[i]) {
    int v = to[i];
    dfs(v);
    long long p1 = s11, p2 = s12;
    s2 = s2 * (f[v][0] + 1ll) % p;
    s11 = (p1 + (p2 + 1ll) * f[v][1] % p) % p;
    s12 = (p2 + p1 * f[v][1] % p) % p;
    long long f1 = f[u][1], f2 = f[u][0];
    f[u][0] = (f1 * f[v][1] % p + f2 * (f[v][0] + 1ll) % p) % p;
    f[u][1] = (f1 * (f[v][0] + 1ll) % p + f2 * f[v][1] % p + (long long)p) % p;
  }
  f[u][1] = (2ll * f[u][1] - s2 + (long long)p) % p;
  f[u][0] = (2ll * f[u][0] - s11 + (long long)p) % p;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) f[i][1] = f[i][0] = fst[i] = 0;
  int u;
  m = 0;
  for (int v = 2; v <= n; ++v) {
    scanf("%d", &u);
    to[++m] = v;
    nxt[m] = fst[u];
    fst[u] = m;
  }
  dfs(1);
  printf("%d\n", (f[1][0] + f[1][1]) % p);
}
