#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
const long double Pi = 3.14159265359;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long N = 2e5 + 10;
const long long INF = 1e18;
const long long LOG = 20;
vector<long long> G[N];
long long dp[N][2], n, p, dp2[N][2], dp3[N][2], dp4[N];
long long ans;
void DFS(long long v, long long p = 0) {
  vector<long long> childs;
  dp[v][0] = 1;
  for (auto u : G[v]) {
    if (u == p) continue;
    childs.push_back(u);
    DFS(u, v);
  }
  if (childs.size()) sort(childs.begin(), childs.end());
  dp2[0][0] = 1;
  dp2[0][1] = 0;
  dp4[0] = 1;
  for (int i = 0; i < childs.size(); i++) {
    dp2[i + 1][0] = ((dp[childs[i]][0] * dp2[i][0]) % MOD) +
                    ((dp[childs[i]][1] * dp2[i][1]) % MOD);
    dp2[i + 1][1] = ((dp[childs[i]][0] * dp2[i][1]) % MOD) +
                    ((dp[childs[i]][1] * dp2[i][0]) % MOD);
    dp4[i + 1] = dp4[i] * dp[childs[i]][0];
    dp2[i + 1][0] %= MOD;
    dp2[i + 1][1] %= MOD;
    dp4[i + 1] %= MOD;
  }
  if (childs.size()) dp3[1][1] = dp[childs[0]][1], dp3[1][0] = 1;
  for (int i = 1; i < childs.size(); i++) {
    dp3[i + 1][0] = dp3[i][0] + (dp3[i][1] * dp[childs[i]][1]) % MOD;
    dp3[i + 1][1] = dp3[i][1] + (dp3[i][0] * dp[childs[i]][1]) % MOD;
    dp3[i + 1][0] %= MOD;
    dp3[i + 1][1] %= MOD;
  }
  dp[v][0] += 2 * dp2[childs.size()][1] - dp3[childs.size()][1];
  dp[v][1] += 2 * dp2[childs.size()][0] - dp4[childs.size()];
  dp[v][0] %= MOD;
  dp[v][1] %= MOD;
}
int main() {
  cin >> n;
  for (int i = 2; i <= n; i++) {
    cin >> p;
    G[i].push_back(p);
    G[p].push_back(i);
  }
  DFS(1);
  ans = dp[1][0] + dp[1][1] - 1;
  ans %= MOD;
  ans += MOD;
  ans %= MOD;
  cout << ans;
  return 0;
}
