#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, root = 1, mod = 1e9 + 7;
vector<int> a[N];
long long dp[2][N], ans[N];
void dfs(int v, int p = 0) {
  dp[0][v] = 1;
  dp[1][v] = 0;
  long long d_even = 1, d_odd = 0;
  long long even = 1, odd_o = 0, odd_e = 1, poe = 1, poo = 0;
  for (auto u : a[v]) {
    if (u == p) continue;
    dfs(u, v);
    dp[0][v] = d_even * dp[0][u] + d_odd * dp[1][u] + d_even;
    dp[0][v] %= mod;
    dp[1][v] = d_odd * dp[0][u] + d_even * dp[1][u] + d_odd;
    dp[1][v] %= mod;
    d_even = dp[0][v];
    d_odd = dp[1][v];
    even = even * (1 + dp[0][u]);
    even %= mod;
    odd_o = poo + dp[1][u] * poe;
    odd_o %= mod;
    odd_e = poe + dp[1][u] * poo;
    odd_e %= mod;
    poo = odd_o;
    poe = odd_e;
  }
  if (a[v].size() == 1 && v != root) {
    even = 1;
    odd_o = 0;
  }
  swap(dp[0][v], dp[1][v]);
  dp[0][v] *= 2;
  dp[0][v] %= mod;
  dp[1][v] *= 2;
  dp[1][v] %= mod;
  dp[1][v] -= even;
  dp[1][v] += mod;
  dp[1][v] %= mod;
  dp[0][v] -= odd_o;
  dp[0][v] += mod;
  dp[0][v] %= mod;
  ans[v] = dp[1][v] + dp[0][v];
  ans[v] %= mod;
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int t;
    cin >> t;
    a[i].push_back(t);
    a[t].push_back(i);
  }
  dfs(root);
  cout << ans[root] << '\n';
}
