#include <bits/stdc++.h>
using namespace std;
int get() {
  char c;
  while (c = getchar(), (c < '0' || c > '9') && (c != '-'))
    ;
  bool flag = (c == '-');
  if (flag) c = getchar();
  int x = 0;
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - 48;
    c = getchar();
  }
  return flag ? -x : x;
}
void output(int x) {
  if (x < 0) {
    putchar('-');
    x = -x;
  }
  int len = 0, data[10];
  while (x) {
    data[len++] = x % 10;
    x /= 10;
  }
  if (!len) data[len++] = 0;
  while (len--) putchar(data[len] + 48);
  putchar('\n');
}
const int maxn = 100000;
const int mod = 1000000007;
vector<int> child[maxn];
long long dp[maxn][2], f[maxn][2], g[maxn][2], h[maxn][2];
void solve(int x) {
  int m = child[x].size();
  if (!m) {
    dp[x][0] = 0;
    dp[x][1] = 1;
    return;
  }
  for (int i = 0; i < m; i++) solve(child[x][i]);
  f[0][0] = g[0][0] = h[0][0] = 0;
  f[0][1] = g[0][1] = h[0][1] = 1;
  for (int i = 0; i < m; i++) {
    int y = child[x][i];
    f[i + 1][0] = (f[i][0] + f[i][0] * dp[y][0] + f[i][1] * dp[y][1]) % mod;
    f[i + 1][1] = (f[i][1] + f[i][0] * dp[y][1] + f[i][1] * dp[y][0]) % mod;
    g[i + 1][0] = (g[i][0] + g[i][0] * dp[y][0]) % mod;
    g[i + 1][1] = (g[i][1] + g[i][1] * dp[y][0]) % mod;
    h[i + 1][0] = (h[i][0] + h[i][1] * dp[y][1]) % mod;
    h[i + 1][1] = (h[i][1] + h[i][0] * dp[y][1]) % mod;
  }
  dp[x][0] = (f[m][0] * 2 - g[m][0] - h[m][0]) % mod;
  dp[x][1] = (f[m][1] * 2 - g[m][1]) % mod;
}
int main() {
  int n = get();
  for (int i = 1; i < n; i++) child[get() - 1].push_back(i);
  solve(0);
  int ans = (dp[0][0] + dp[0][1]) % mod;
  if (ans < 0) ans += mod;
  output(ans);
  return 0;
}
