#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int s = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) s = s * 10 + ch - '0', ch = getchar();
  return s;
}
const int N = 1e5 + 5, mod = 1e9 + 7;
int n;
int fa[N];
vector<int> G[N];
int f[N][2], g[N][2][2];
void dfs(int u) {
  g[u][0][0] = g[u][0][1] = f[u][1] = 1;
  for (int v : G[u]) {
    dfs(v);
    int t0 = f[u][0];
    f[u][0] =
        (f[u][0] + 1ll * f[u][0] * f[v][0] + 1ll * f[u][1] * f[v][1]) % mod;
    f[u][1] = (f[u][1] + 1ll * t0 * f[v][1] + 1ll * f[u][1] * f[v][0]) % mod;
    int t1 = g[u][0][1];
    g[u][0][0] = (g[u][0][0] + 1ll * g[u][0][0] * f[v][0]) % mod;
    g[u][0][1] = (g[u][0][1] + 1ll * g[u][1][1] * f[v][1]) % mod;
    g[u][1][1] = (g[u][1][1] + 1ll * t1 * f[v][1]) % mod;
  }
  f[u][0] = (2ll * f[u][0] - g[u][1][1] + mod) % mod;
  f[u][1] = (2ll * f[u][1] - g[u][0][0] + mod) % mod;
}
int main() {
  n = read();
  for (int i = 2; i <= n; i++) fa[i] = read(), G[fa[i]].push_back(i);
  dfs(1);
  printf("%d\n", (f[1][0] + f[1][1]) % mod);
  return 0;
}
