#include <bits/stdc++.h>
using namespace ::std;
const long long maxn = 1e5 + 500;
const long long mod = 1e9 + 7;
const long long inf = 1e9 + 500;
vector<long long> child[maxn];
long long dp[maxn][2];
void dfs(long long a) {
  dp[a][0] = 0;
  dp[a][1] = 1;
  for (long long i = 0; i < child[a].size(); i++) {
    long long v = child[a][i];
    dfs(v);
  }
  for (long long i = 0; i < child[a].size(); i++) {
    long long v = child[a][i];
    long long s0 = dp[a][0];
    long long s1 = dp[a][1];
    dp[a][0] = (((s0 * dp[v][0]) % mod + (s1 * dp[v][1]) % mod) + s0) % mod;
    dp[a][1] = (((s0 * dp[v][1]) % mod + (s1 * dp[v][0]) % mod) + s1) % mod;
  }
  dp[a][0] = (dp[a][0] * 2) % mod;
  dp[a][1] = (dp[a][1] * 2) % mod;
  long long tekr[2];
  long long t0 = 1;
  tekr[0] = 1;
  tekr[1] = 0;
  for (long long i = 0; i < child[a].size(); i++) {
    long long v = child[a][i];
    t0 = ((dp[v][0] + 1) * t0) % mod;
    long long te0 = tekr[0];
    long long te1 = tekr[1];
    tekr[0] = ((dp[v][1]) * te1 + te0) % mod;
    tekr[1] = ((dp[v][1]) * te0 + te1) % mod;
  }
  dp[a][0] = (dp[a][0] - tekr[1] + mod) % mod;
  dp[a][1] = (dp[a][1] - t0 + mod) % mod;
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 2; i <= n; i++) {
    long long p;
    cin >> p;
    p--;
    child[p].push_back(i - 1);
  }
  dfs(0);
  cout << (dp[0][0] + dp[0][1]) % mod;
}
