#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int n;
int par[100000];
int fst[100000], nxt[100000];
int evn[100000], odd[100000];
void go(int at) {
  int e = 0, o = 1, alle = 1, eallo = 1, oallo = 0;
  for (int to = fst[at]; to != -1; to = nxt[to]) {
    go(to);
    int ne = (((long long)(e) +
               ((((long long)((((long long)(e) * (evn[to])) % MOD)) +
                  ((((long long)(o) * (odd[to])) % MOD))) %
                 MOD))) %
              MOD);
    int no = (((long long)(o) +
               ((((long long)((((long long)(e) * (odd[to])) % MOD)) +
                  ((((long long)(o) * (evn[to])) % MOD))) %
                 MOD))) %
              MOD);
    int nalle =
        (((long long)(alle) + ((((long long)(alle) * (evn[to])) % MOD))) % MOD);
    int neallo =
        (((long long)(eallo) + ((((long long)(oallo) * (odd[to])) % MOD))) %
         MOD);
    int noallo =
        (((long long)(oallo) + ((((long long)(eallo) * (odd[to])) % MOD))) %
         MOD);
    e = ne, o = no, alle = nalle, eallo = neallo, oallo = noallo;
  }
  evn[at] =
      (((long long)((((long long)(e) * (2)) % MOD)) - (oallo) + MOD) % MOD);
  odd[at] =
      (((long long)((((long long)(o) * (2)) % MOD)) - (alle) + MOD) % MOD);
}
void run() {
  scanf("%d", &n);
  par[0] = -1;
  for (int i = (1); i < (n); ++i) {
    scanf("%d", &par[i]);
    --par[i];
  }
  memset(fst, -1, sizeof(fst));
  for (int i = n - 1; i >= 1; --i) {
    nxt[i] = fst[par[i]];
    fst[par[i]] = i;
  }
  go(0);
  int ret = (((long long)(evn[0]) + (odd[0])) % MOD);
  printf("%d\n", ret);
}
int main() {
  run();
  return 0;
}
