#include <bits/stdc++.h>
using namespace std;
int mod = 1e9 + 7;
const int maxn = 1e5 + 50;
long long int dp[2][maxn], child[maxn];
vector<int> adj[maxn];
void dfs(int v, int p) {
  if (child[v] == 0) {
    dp[0][v] = 1;
    dp[1][v] = 1;
    return;
  }
  long long int odd = 0, even = 1, alle = 1, nod0 = 1, nod1 = 0;
  for (int u : adj[v]) {
    if (u == p) {
      continue;
    }
    dfs(u, v);
    alle = (alle * dp[0][u]) % mod;
    long long int ho, he;
    ho = odd * dp[0][u] + even * dp[1][u];
    he = odd * dp[1][u] + even * dp[0][u];
    odd = ho % mod;
    even = he % mod;
    ho = nod0 * dp[1][u] + nod1;
    he = nod1 * dp[1][u] + nod0;
    nod1 = ho % mod;
    nod0 = he % mod;
  }
  even *= 2;
  even -= alle;
  odd *= 2;
  odd -= nod1;
  dp[0][v] = (odd + 1) % mod;
  dp[1][v] = even % mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    child[p]++;
    adj[p].push_back(i);
    adj[i].push_back(p);
  }
  dfs(1, 1);
  for (int i = 1; i <= n; i++) {
  }
  long long int ans = dp[0][1] + dp[1][1] - 1;
  ans %= mod;
  if (ans < 0) ans += mod;
  cout << ans;
  return 0;
}
