#include <bits/stdc++.h>
using namespace std;
bool debug = 1;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
long long ln, lk, lm;
int dp[100005][2];
vector<int> mp[100005];
void cal() {
  for (int u = n; u >= 1; u--) {
    dp[u][0] = 0;
    dp[u][1] = 1;
    if (mp[u].empty()) continue;
    for (int v : mp[u]) {
      long long a = (long long)dp[v][0] * dp[u][0] % 1000000007 +
                    (long long)dp[u][1] * dp[v][1] % 1000000007;
      long long b = (long long)dp[v][0] * dp[u][1] % 1000000007 +
                    (long long)dp[u][0] * dp[v][1] % 1000000007;
      a %= 1000000007;
      b %= 1000000007;
      dp[u][0] = (a + dp[u][0]) % 1000000007;
      dp[u][1] = (b + dp[u][1]) % 1000000007;
    }
    dp[u][0] = ((long long)dp[u][0] * 2) % 1000000007;
    dp[u][1] = (long long)dp[u][1] * 2 % 1000000007;
    long long p[3] = {1, 1, 0}, tmp;
    for (int v : mp[u]) {
      p[0] = (p[0] * dp[v][0] % 1000000007 + p[0]) % 1000000007;
      tmp = p[2];
      p[2] = (p[1] * dp[v][1] % 1000000007 + p[2]) % 1000000007;
      p[1] = (tmp * dp[v][1] % 1000000007 + p[1]) % 1000000007;
    }
    dp[u][1] = (dp[u][1] + 1000000007 - p[0]) % 1000000007;
    dp[u][0] = (dp[u][0] + 1000000007 - p[2]) % 1000000007;
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    scanf("%d", &k);
    mp[k].push_back(i);
  }
  cal();
  printf("%d\n", (dp[1][0] + dp[1][1]) % 1000000007);
  return 0;
}
