#include <bits/stdc++.h>
using namespace std;
int n, u, i;
long long h[2][2], f[100010], g[100010];
vector<int> son[100010];
inline int gi() {
  int s = 0;
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  while (c >= '0' && c <= '9') s = s * 10 + c - '0', c = getchar();
  return s;
}
void Work() {
  for (int x = n; x >= 1; x--) {
    int s = son[x].size();
    f[x] = 1, g[x] = 0;
    int cur = 1;
    h[0][0] = 1, h[0][1] = h[1][0] = h[1][1] = 0;
    for (i = 0; i < s; i++, cur ^= 1) {
      int v = son[x][i];
      h[cur][0] = (h[cur ^ 1][0] * f[v] + h[cur ^ 1][1] * g[v]) % 1000000007;
      h[cur][1] = (h[cur ^ 1][0] * g[v] + h[cur ^ 1][1] * f[v]) % 1000000007;
    }
    f[x] += h[cur ^ 1][1] << 1, g[x] += h[cur ^ 1][0] << 1;
    h[0][0] = 1, h[0][1] = h[1][0] = h[1][1] = 0;
    for (i = 0, cur = 1; i < s; i++, cur ^= 1) {
      int v = son[x][i];
      h[cur][0] = (h[cur ^ 1][0] + h[cur ^ 1][1] * g[v]) % 1000000007;
      h[cur][1] = (h[cur ^ 1][1] + h[cur ^ 1][0] * g[v]) % 1000000007;
    }
    f[x] -= h[cur ^ 1][1];
    h[0][0] = 1;
    for (i = 0; i < s; i++) h[0][0] = h[0][0] * f[son[x][i]] % 1000000007;
    g[x] -= h[0][0];
    f[x] = f[x] % 1000000007, g[x] = g[x] % 1000000007;
  }
}
int main() {
  scanf("%d", &n);
  for (i = 2; i <= n; i++) u = gi(), son[u].push_back(i);
  for (i = 1; i <= n; i++) sort(son[i].begin(), son[i].end());
  Work();
  printf("%I64d\n", ((f[1] + g[1] - 1) % 1000000007 + 1000000007) % 1000000007);
  return 0;
}
