#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> v[100100];
long long A[100100], B[100100];
void input() {
  scanf("%d", &n);
  for (int x, i = 2; i <= n; i++) {
    scanf("%d", &x);
    v[x].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    sort(v[i].begin(), v[i].end());
  }
}
long long a[100100], b[100100];
int m;
void push_up(int x) {
  m = v[x].size() - 1;
  if (m == -1) {
    A[x] = 1;
    B[x] = 1;
    return;
  }
  for (int y, i = 0; i <= m; i++) {
    y = v[x][i];
    a[i] = A[y];
    b[i] = B[y];
  }
  if (!m) {
    A[x] = b[0];
    B[x] = (a[0] + 1) % 1000000007;
    return;
  }
  long long aa = 1, bb = 0;
  long long uu, vv;
  for (int i = 0; i <= m; i++) {
    uu = (aa * b[i] + bb * a[i]) % 1000000007;
    vv = (aa * a[i] + bb * b[i]) % 1000000007;
    aa = uu;
    bb = vv;
  }
  A[x] = 2 * aa % 1000000007;
  B[x] = (1 + 2 * bb) % 1000000007;
  long long d = 1;
  for (int i = 0; i <= m; i++) {
    d = d * b[i] % 1000000007;
  }
  A[x] -= d;
  while (A[x] < 0) A[x] += 1000000007;
  long long q[4] = {1, 0, 0, 0};
  long long Q[4];
  for (int i = 0; i <= m; i++) {
    for (int j = 0; j < 4; j++) {
      Q[j] = q[j];
    }
    for (int jj, j = 0; j < 4; j++) {
      jj = (j + 1) % 4;
      Q[jj] = (Q[jj] + q[j] * a[i]) % 1000000007;
    }
    for (int j = 0; j < 4; j++) q[j] = Q[j];
  }
  B[x] -= q[3] + q[1];
  while (B[x] < 0) B[x] += 1000000007;
}
void solve() {
  for (int x = n; x; x--) push_up(x);
  printf("%I64d\n", (A[1] + B[1] + 1000000007 - 1) % 1000000007);
}
int main() {
  input();
  solve();
  return 0;
}
