#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const long long MOD = 1e9 + 7;
template <typename T>
inline void read(T &AKNOI) {
  T x = 0, flag = 1;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') flag = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    x = x * 10 + ch - '0';
    ch = getchar();
  }
  AKNOI = flag * x;
}
inline void Inc(long long &x, long long y) { (x += y) %= MOD; }
inline void Dec(long long &x, long long y) { x = (x - y + MOD) % MOD; }
int n;
long long dp[MAXN][2];
vector<int> g[MAXN];
void DFS(int u) {
  dp[u][0] = 0;
  dp[u][1] = 1;
  if (!g[u].size()) return;
  for (auto v : g[u]) {
    DFS(v);
    long long u0 = dp[u][0], u1 = dp[u][1];
    Inc(dp[u][0], u0 * dp[v][0]);
    Inc(dp[u][0], u1 * dp[v][1]);
    Inc(dp[u][1], u0 * dp[v][1]);
    Inc(dp[u][1], u1 * dp[v][0]);
  }
  Inc(dp[u][0], dp[u][0]);
  Inc(dp[u][1], dp[u][1]);
  long long s0 = 1, s1 = 1, s2 = 0;
  for (auto v : g[u]) {
    Inc(s0, s0 * dp[v][0]);
    long long tmp1 = s1, tmp2 = s2;
    Inc(s1, tmp2 * dp[v][1]);
    Inc(s2, tmp1 * dp[v][1]);
  }
  Dec(dp[u][0], s2);
  Dec(dp[u][1], s0);
}
void solve() {
  read(n);
  for (int i = 2; i <= n; ++i) {
    int p;
    read(p);
    g[p].push_back(i);
  }
  DFS(1);
  printf("%lld\n", (dp[1][0] + dp[1][1]) % MOD);
}
int main() {
  solve();
  return 0;
}
