#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ '0'), c = getchar();
  return x * f;
}
const int N = 1e5 + 5, mod = 1e9 + 7;
inline int inc(int x, int y) {
  x += y - mod;
  return x + (x >> 31 & mod);
}
inline int del(int x, int y) {
  x -= y;
  return x + (x >> 31 & mod);
}
inline int mul(int x, int y) { return 1ll * x * y % mod; }
inline void Inc(int &x, int y) { x = inc(x, y); }
inline void Del(int &x, int y) { x = del(x, y); }
inline void Mul(int &x, int y) { x = mul(x, y); }
vector<int> e[N];
int f[N][2], n;
void dfs() {
  for (int x = n; x >= 1; x--) {
    f[x][1] = 1, f[x][0] = 0;
    if (!e[x].size()) continue;
    for (auto y : e[x]) {
      long long v1 = inc(mul(f[x][0], f[y][0]), mul(f[x][1], f[y][1]));
      long long v2 = inc(mul(f[x][0], f[y][1]), mul(f[x][1], f[y][0]));
      Inc(f[x][0], v1);
      Inc(f[x][1], v2);
    }
    Mul(f[x][0], 2), Mul(f[x][1], 2);
    int g[2][2];
    g[0][0] = g[0][1] = 1;
    g[1][0] = g[1][1] = 0;
    for (auto y : e[x]) {
      int val = g[1][0];
      Inc(g[1][0], mul(f[y][0], g[0][0]));
      Inc(g[0][0], mul(f[y][0], val));
      val = g[1][1];
      Inc(g[1][1], mul(f[y][1], g[0][1]));
      Inc(g[0][1], mul(f[y][1], val));
    }
    Del(f[x][1], inc(g[0][0], g[1][0]));
    Del(f[x][0], g[1][1]);
  }
}
void solve() {
  n = read();
  for (int i = 1; i <= n; i++) e[i].clear();
  for (int i = 2; i <= n; i++) {
    int x = read();
    e[x].push_back(i);
  }
  dfs();
  printf("%d\n", inc(f[1][1], f[1][0]));
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
