#include <bits/stdc++.h>
using namespace std;
const int MAXn = 1e5 + 10, MOD = 1e9 + 7;
vector<int> g[MAXn];
int n;
long long dp[MAXn][2];
void dfs(int v) {
  long long ansodd = 1, anseven = 0, hp, hp2;
  for (int i = 0; i < g[v].size(); i++) {
    dfs(g[v][i]);
    hp = ansodd;
    hp2 = anseven;
    ansodd += (anseven * dp[g[v][i]][1]) % MOD;
    ansodd %= MOD;
    ansodd += (hp * (dp[g[v][i]][0])) % MOD;
    ansodd %= MOD;
    anseven += (hp2 * (dp[g[v][i]][0])) % MOD;
    anseven %= MOD;
    anseven += (hp * dp[g[v][i]][1]) % MOD;
    anseven %= MOD;
  }
  dp[v][0] = (2 * anseven) % MOD;
  dp[v][1] = (2 * ansodd) % MOD;
  long long oddans[2] = {0, 0}, evenans[2] = {1, 1}, hpoddans[2] = {0, 0},
            hpevenans[2] = {1, 1};
  ;
  for (int i = 0; i < g[v].size(); i++) {
    hpoddans[0] = oddans[0];
    hpoddans[1] = oddans[1];
    hpevenans[0] = evenans[0];
    hpevenans[1] = evenans[1];
    oddans[0] += (evenans[0] * dp[g[v][i]][0]) % MOD;
    oddans[0] %= MOD;
    oddans[1] += (evenans[1] * dp[g[v][i]][1]) % MOD;
    oddans[1] %= MOD;
    evenans[0] += (hpoddans[0] * dp[g[v][i]][0]) % MOD;
    evenans[0] %= MOD;
    evenans[1] += (hpoddans[1] * dp[g[v][i]][1]) % MOD;
    evenans[1] %= MOD;
  }
  dp[v][0] += MOD - oddans[1] + MOD;
  dp[v][1] += MOD - evenans[0] + MOD - oddans[0];
  dp[v][0] %= MOD;
  dp[v][1] %= MOD;
}
int main() {
  cin >> n;
  for (int i = 1; i <= n - 1; i++) {
    int p;
    cin >> p;
    p--;
    g[p].push_back(i);
  }
  for (int i = 0; i < n; i++) sort(g[i].begin(), g[i].end());
  dfs(0);
  cout << (dp[0][0] + dp[0][1]) % MOD;
}
