#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void scan_d(T &ret) {
  char c;
  int flag = 0;
  ret = 0;
  while (((c = getchar()) < '0' || c > '9') && c != '-')
    ;
  if (c == '-') {
    flag = 1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') ret = ret * 10 + (c - '0'), c = getchar();
  if (flag) ret = -ret;
}
const int maxn = 100000 + 10;
vector<int> G[maxn];
long long dp[maxn][2];
void solve(int n) {
  for (int u = n; u >= 1; u--) {
    dp[u][1] = 1;
    dp[u][0] = 0;
    int sz = G[u].size();
    if (!sz) continue;
    for (int i = 0; i < sz; i++) {
      int v = G[u][i];
      long long a = (dp[u][0] * dp[v][0] % 1000000007 +
                     dp[u][1] * dp[v][1] % 1000000007) %
                    1000000007;
      long long b = (dp[u][1] * dp[v][0] % 1000000007 +
                     dp[u][0] * dp[v][1] % 1000000007) %
                    1000000007;
      dp[u][0] = (dp[u][0] + a) % 1000000007;
      dp[u][1] = (dp[u][1] + b) % 1000000007;
    }
    dp[u][0] = (dp[u][0] * 2LL) % 1000000007;
    dp[u][1] = (dp[u][1] * 2LL) % 1000000007;
    long long p[3] = {1, 1, 0}, tmp;
    for (int i = 0; i < sz; i++) {
      int v = G[u][i];
      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] - p[0] + 1000000007) % 1000000007;
    dp[u][0] = (dp[u][0] - p[2] + 1000000007) % 1000000007;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 2; i <= n; i++) {
    int p;
    scanf("%d", &p);
    G[p].push_back(i);
  }
  solve(n);
  printf("%I64d\n", (dp[1][0] + dp[1][1]) % 1000000007);
  return 0;
}
