#include <bits/stdc++.h>
using namespace std;
int const N = 1e5 + 10, mod = 1e9 + 7;
int n, par[N], dp[2][N];
vector<int> g[N];
void dfs(int v) {
  dp[1][v]++;
  for (int u : g[v]) {
    dfs(u);
    int new0 =
        (dp[0][v] + dp[0][v] * dp[0][u] % mod + dp[1][v] * dp[1][u] % mod) %
        mod;
    int new1 =
        (dp[1][v] + dp[1][v] * dp[0][u] % mod + dp[0][v] * dp[1][u] % mod) %
        mod;
    dp[0][v] = new0, dp[1][v] = new1;
  }
  dp[0][v] = 2 * dp[0][v] % mod, dp[1][v] = 2 * dp[1][v] % mod;
  int t[2][2], d[2][2];
  memset(t, 0, sizeof t);
  memset(d, 0, sizeof d);
  t[0][0]++, t[0][1]++;
  for (int u : g[v]) {
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        d[i][j] = (t[i][j] + t[!i][j] * dp[j][u]) % mod;
      }
    }
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        t[i][j] = d[i][j];
      }
    }
  }
  dp[0][v] = (dp[0][v] - t[1][1] + mod) % mod;
  dp[1][v] = (dp[1][v] - t[0][0] - t[1][0] + mod + mod) % mod;
}
int32_t main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> par[i];
    par[i]--;
    g[par[i]].push_back(i);
  }
  dfs(0);
  cout << (dp[0][0] + dp[1][0]) % mod << '\n';
}
