#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 100, P = 1e9 + 7;
long long t;
long long n;
struct Node {
  long long y, Next;
} e[2 * N];
long long len, linkk[N];
long long f[N][2];
void Insert(long long x, long long y) {
  e[++len] = (Node){y, linkk[x]};
  linkk[x] = len;
}
void work() {
  scanf("%lld", &n);
  for (long long i = 2, x; i <= n; i++) scanf("%lld", &x), Insert(x, i);
  for (long long x = n; x; x--) {
    f[x][0] = 0, f[x][1] = 1;
    if (linkk[x] == 0) continue;
    for (long long i = linkk[x]; i; i = e[i].Next) {
      long long y = e[i].y;
      long long ans0 = f[x][0], ans1 = f[x][1];
      f[x][0] = (f[x][0] + ans0 * 1ll * f[y][0] % P) % P;
      f[x][0] = (f[x][0] + ans1 * 1ll * f[y][1] % P) % P;
      f[x][1] = (f[x][1] + ans0 * 1ll * f[y][1] % P) % P;
      f[x][1] = (f[x][1] + ans1 * 1ll * f[y][0] % P) % P;
    }
    f[x][0] = f[x][0] * 1ll * 2 % P;
    f[x][1] = f[x][1] = f[x][1] * 1ll * 2 % P;
    long long ans1 = 1, ans2 = 1, ans3 = 0;
    for (long long i = linkk[x]; i; i = e[i].Next) {
      long long y = e[i].y;
      ans1 = (ans1 + ans1 * 1ll * f[y][0] % P) % P;
      long long cnt1 = ans2, cnt2 = ans3;
      ans2 = (ans2 + ans3 * 1ll * f[y][1] % P) % P;
      ans3 = (cnt2 + cnt1 * 1ll * f[y][1] % P) % P;
    }
    f[x][0] = ((f[x][0] - ans3) % P + P) % P;
    f[x][1] = ((f[x][1] - ans1) % P + P) % P;
  }
  printf("%lld\n", (f[1][0] + f[1][1]) % P);
  for (long long i = 1; i <= n; i++) f[i][0] = f[i][1] = 0, linkk[i] = 0;
  len = 0;
}
signed main() {
  work();
  return 0;
}
