#include <bits/stdc++.h>
using namespace std;
inline int read() {
  register int data = 0, w = 1;
  char ch = 0;
  while (ch != '-' && (ch < '0' || ch > '9')) ch = getchar();
  if (ch == '-') w = -1, ch = getchar();
  while (ch >= '0' && ch <= '9')
    data = (data << 1) + (data << 3) + (ch ^ 48), ch = getchar();
  return data * w;
}
int T, n, f[100005][2], g[2];
vector<int> v[100005];
const int mod = 1e9 + 7;
void dfs(int x) {
  f[x][1] = 1;
  for (auto y : v[x]) {
    dfs(y);
    int f0 = f[x][0], f1 = f[x][1];
    f[x][0] = (1ll * f0 * (1 + f[y][0]) + 1ll * f1 * f[y][1]) % mod;
    f[x][1] = (1ll * f0 * f[y][1] + 1ll * f1 * (1 + f[y][0])) % mod;
  }
  f[x][0] = (f[x][0] << 1) % mod;
  f[x][1] = (f[x][1] << 1) % mod;
  for (int p = 0; p <= 1; p++) {
    memset(g, 0, sizeof(g));
    g[0] = 1;
    for (auto y : v[x]) {
      int g0 = g[0], g1 = g[1];
      g[0] = (g[0] + 1ll * f[y][p] * g0 * (p == 0) +
              1ll * f[y][p] * g1 * (p == 1)) %
             mod;
      g[1] = (g[1] + 1ll * f[y][p] * g0 * (p == 1) +
              1ll * f[y][p] * g1 * (p == 0)) %
             mod;
    }
    f[x][p ^ 1] = (f[x][p ^ 1] - g[p] + mod) % mod;
  }
}
int main() {
  n = read();
  for (int i = 1; i <= n; i++) v[i].clear();
  for (int i = 2; i <= n; i++) v[read()].push_back(i);
  for (int i = 1; i <= n; i++) sort(v[i].begin(), v[i].end());
  dfs(1);
  cout << (f[1][0] + f[1][1]) % mod << '\n';
  return 0;
}
