#include <bits/stdc++.h>
using namespace std;
const int mod = 1000000007;
inline int add(int a, int b) {
  if ((a += b) >= mod) a -= mod;
  return a;
}
int dp[100010][2], n;
vector<int> t[100010];
int main() {
  scanf("%d", &n);
  for (int i = 2, ti; i <= n; i++) {
    scanf("%d", &ti);
    t[ti].push_back(i);
  }
  for (int u = n; u >= 1; u--) {
    dp[u][1] = 1, dp[u][0] = 0;
    if (!t[u].size()) continue;
    for (auto &v : t[u]) {
      int t0 = dp[u][0], t1 = dp[u][1];
      dp[u][1] = add(dp[u][1], (long long)t1 * dp[v][0] % mod);
      dp[u][1] = add(dp[u][1], (long long)t0 * dp[v][1] % mod);
      dp[u][0] = add(dp[u][0], (long long)t0 * dp[v][0] % mod);
      dp[u][0] = add(dp[u][0], (long long)t1 * dp[v][1] % mod);
    }
    dp[u][0] = add(dp[u][0], dp[u][0]);
    dp[u][1] = add(dp[u][1], dp[u][1]);
    int a = 1, b = 1, c = 0;
    for (auto v : t[u]) {
      a = add(a, (long long)a * dp[v][0] % mod);
      int tb = b, tc = c;
      b = add(b, (long long)tc * dp[v][1] % mod);
      c = add(c, (long long)tb * dp[v][1] % mod);
    }
    dp[u][0] = add(dp[u][0], mod - c);
    dp[u][1] = add(dp[u][1], mod - a);
  }
  printf("%d\n", add(dp[1][0], dp[1][1]));
  return 0;
}
