#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
const long long maxn = 2e5 + 5, N = 1000, SQ = 1000, base = 800287,
                mod = 1e9 + 7, INF = 1e9 + 5, lg = 20;
const long double eps = 1e-4;
long long n, dp1[maxn], dp2[maxn];
vector<long long> edges[maxn];
void dfs(long long v, long long p = -1) {
  for (auto u : edges[v]) {
    if (u != p) {
      dfs(u, v);
    }
  }
  long long tot1 = 0, tot2 = 1;
  for (long long i = 0; i < (long long)edges[v].size(); ++i) {
    long long u = edges[v][i];
    if (u == p) {
      continue;
    }
    long long a =
        (((tot1 * (dp1[u] + 1)) % mod) + ((tot2 * dp2[u]) % mod)) % mod;
    long long b =
        (((tot1 * dp2[u]) % mod) + ((tot2 * (dp1[u] + 1)) % mod)) % mod;
    tot1 = a, tot2 = b;
  }
  dp1[v] += tot1, dp2[v] += tot2;
  tot1 = 0, tot2 = 1;
  for (long long i = (long long)edges[v].size() - 1; i >= 0; --i) {
    long long u = edges[v][i];
    if (u == p) {
      continue;
    }
    long long a =
        (((tot1 * (dp1[u] + 1)) % mod) + ((tot2 * dp2[u]) % mod)) % mod;
    long long b =
        (((tot1 * dp2[u]) % mod) + ((tot2 * (dp1[u] + 1)) % mod)) % mod;
    tot1 = a, tot2 = b;
  }
  dp1[v] += tot1, dp2[v] += tot2;
  dp1[v] %= mod, dp2[v] %= mod;
  long long all_even = 1, all_odd1 = 1, all_odd2 = 0;
  for (long long i = 0; i < (long long)edges[v].size(); ++i) {
    long long u = edges[v][i];
    if (u == p) {
      continue;
    }
    all_even = (all_even * (dp1[u] + 1)) % mod;
    long long a = (all_odd1 + (all_odd2 * dp2[u]) % mod) % mod;
    long long b = (all_odd2 + (all_odd1 * dp2[u]) % mod) % mod;
    all_odd1 = a, all_odd2 = b;
  }
  dp2[v] = (dp2[v] - all_even + mod) % mod;
  dp1[v] = (dp1[v] - all_odd2 + mod) % mod;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i < n; ++i) {
    long long p;
    cin >> p;
    p--;
    edges[p].push_back(i);
    edges[i].push_back(p);
  }
  for (long long i = 0; i < n; ++i) {
    sort(edges[i].begin(), edges[i].end());
  }
  dfs(0);
  cout << (dp1[0] + dp2[0]) % mod << '\n';
}
