#include <bits/stdc++.h>
using namespace std;
int n;
vector<int> adj[100005];
long long val[100005][2][2];
long long calc(int u, int st, int en) {
  long long& rlt = val[u][st][en];
  long long c[2], d[2], s, t;
  int k = int((adj[u]).size()), i, v;
  if (rlt != -1) return rlt;
  c[0] = c[1] = 0;
  c[1 - st] = s = 1;
  for (i = 0; i < k; i++) {
    v = adj[u][i];
    d[0] = c[0] + c[0] * calc(v, 0, 0) + c[1] * calc(v, 1, 0);
    d[1] = c[1] + c[0] * calc(v, 0, 1) + c[1] * calc(v, 1, 1);
    c[0] = d[0] % 1000000007, c[1] = d[1] % 1000000007;
    s = s * (1 + calc(v, 1 - st, 1 - st)) % 1000000007;
  }
  rlt = c[en];
  c[0] = c[1] = 0;
  c[!st] = 1;
  for (i = k - 1; i >= 0; i--) {
    v = adj[u][i];
    d[0] = c[0] + c[0] * calc(v, 0, 0) + c[1] * calc(v, 1, 0);
    d[1] = c[1] + c[0] * calc(v, 0, 1) + c[1] * calc(v, 1, 1);
    c[0] = d[0] % 1000000007, c[1] = d[1] % 1000000007;
  }
  rlt = (rlt + c[en]) % 1000000007;
  c[0] = c[1] = 0;
  c[1 - st] = 1;
  for (i = 0; i < k; i++) {
    v = adj[u][i];
    d[0] = c[0] + c[1] * calc(v, 1, 0);
    d[1] = c[1] + c[0] * calc(v, 0, 1);
    c[0] = d[0] % 1000000007, c[1] = d[1] % 1000000007;
  }
  t = c[st];
  if (st == en)
    rlt = (rlt - t + 1000000007) % 1000000007;
  else
    rlt = (rlt - s + 1000000007) % 1000000007;
  return rlt;
}
int main() {
  int i, j;
  long long rlt;
  scanf("%d", &n);
  for (j = 2; j <= n; j++) {
    scanf("%d", &i);
    adj[i].push_back(j);
  }
  for (i = 1; i <= n; i++) sort(adj[i].begin(), adj[i].end());
  memset(val, -1, sizeof val);
  rlt = (calc(1, 0, 0) + calc(1, 0, 1)) % 1000000007;
  printf("%d\n", int(rlt));
  return 0;
}
