#include <bits/stdc++.h>
using namespace std;
const int MAXN = 100005;
const int MOD = 1000000007;
vector<int> g[MAXN];
int n;
long long dp[MAXN][2];
long long dp2[2][2];
void dfs(int u) {
  dp[u][0] = 0, dp[u][1] = 1;
  int size = (int)g[u].size();
  if (size == 0) return;
  for (int i = 0; i < size; ++i) dfs(g[u][i]);
  for (int i = 0; i < size; ++i) {
    int v = g[u][i];
    long long add_dp0 = dp[u][0] * dp[v][0] % MOD + dp[u][1] * dp[v][1] % MOD;
    long long add_dp1 = dp[u][1] * dp[v][0] % MOD + dp[u][0] * dp[v][1] % MOD;
    dp[u][0] = (dp[u][0] + add_dp0) % MOD;
    dp[u][1] = (dp[u][1] + add_dp1) % MOD;
  }
  dp[u][0] = (dp[u][0] + dp[u][0]) % MOD;
  dp[u][1] = (dp[u][1] + dp[u][1]) % MOD;
  dp2[0][0] = dp2[1][0] = 1;
  dp2[0][1] = dp2[1][1] = 0;
  for (int i = 0; i < size; ++i) {
    int v = g[u][i];
    long long val = dp2[0][0];
    dp2[0][0] = (dp2[0][0] + dp[v][0] * dp2[0][1]) % MOD;
    dp2[0][1] = (dp2[0][1] + dp[v][0] * val) % MOD;
    val = dp2[1][0];
    dp2[1][0] = (dp2[1][0] + dp[v][1] * dp2[1][1]) % MOD;
    dp2[1][1] = (dp2[1][1] + dp[v][1] * val) % MOD;
  }
  dp[u][0] = (dp[u][0] + MOD - dp2[1][1]) % MOD;
  dp[u][1] = (dp[u][1] + MOD - dp2[0][0] + MOD - dp2[0][1]) % MOD;
}
int MAIN() {
  cin >> n;
  int p;
  for (int i = 2; i <= n; ++i) {
    cin >> p;
    g[p].push_back(i);
  }
  dfs(1);
  cout << (dp[1][0] + dp[1][1]) % MOD << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(16);
  return MAIN();
}
