#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
void ckmin(T &a, U b) {
  if (a > b) a = b;
}
template <class T, class U>
void ckmax(T &a, U b) {
  if (a < b) a = b;
}
int N;
int parent[100013];
vector<int> edge[100013];
array<long long, 2> dp[100013];
long long ans;
void dfs(int u) {
  for (int v : edge[u]) {
    dfs(v);
  }
  array<long long, 2> tmp = {0, 1};
  for (int v : edge[u]) {
    tmp = {tmp[0] * (dp[v][0] + 1) + tmp[1] * dp[v][1],
           tmp[0] * dp[v][1] + tmp[1] * (dp[v][0] + 1)};
    tmp[0] %= 1000000007;
    tmp[1] %= 1000000007;
  }
  dp[u][0] += tmp[0];
  dp[u][1] += tmp[1];
  tmp = {0, 1};
  for (auto i = (((int)((edge[u]).size()))) - 1; i >= (0); i--) {
    int v = edge[u][i];
    tmp = {tmp[0] * (dp[v][0] + 1) + tmp[1] * dp[v][1],
           tmp[0] * dp[v][1] + tmp[1] * (dp[v][0] + 1)};
    tmp[0] %= 1000000007;
    tmp[1] %= 1000000007;
  }
  dp[u][0] += tmp[0];
  dp[u][1] += tmp[1];
  tmp[0] = 1;
  for (int v : edge[u]) {
    tmp[0] *= (dp[v][0] + 1);
    tmp[0] %= 1000000007;
  }
  dp[u][1] -= tmp[0];
  dp[u][1] %= 1000000007;
  if (dp[u][1] < 0) dp[u][1] += 1000000007;
  tmp[0] = 1;
  tmp[1] = 0;
  for (int v : edge[u]) {
    tmp = {tmp[1] * (dp[v][1]) + tmp[0], tmp[0] * (dp[v][1]) + tmp[1]};
    tmp[0] %= 1000000007;
    tmp[1] %= 1000000007;
  }
  dp[u][0] -= tmp[1];
  dp[u][0] %= 1000000007;
  if (dp[u][0] < 0) dp[u][0] += 1000000007;
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cin >> N;
  parent[0] = N;
  for (auto i = (1); i < (N); i++) {
    cin >> parent[i];
    parent[i]--;
    edge[parent[i]].push_back(i);
  }
  dfs(0);
  ans = dp[0][0] + dp[0][1];
  ans %= 1000000007;
  cout << ans << '\n';
  return 0;
}
