#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
const int mo = 1e9 + 7;
vector<int> E[110000];
int f[110000][2], tmp[2][2][3], t, n;
void dfs(int x) {
  for (int i = 0; i < E[x].size(); ++i) dfs(E[x][i]);
  t = 0;
  memset(tmp, 0, sizeof(tmp));
  for (int i = 0; i < E[x].size(); ++i) {
    int y = E[x][i], tt = t ^ 1;
    tmp[tt][0][0] = f[y][0];
    tmp[tt][1][1] = f[y][1];
    for (int j = 0; j <= 1; ++j)
      for (int k = 0; k <= 2; ++k) {
        for (int p = 0; p <= 1; ++p) {
          int x;
          if (k == 2 || k != p)
            x = 2;
          else
            x = k;
          tmp[tt][j ^ p][x] =
              (tmp[tt][j ^ p][x] + 1ll * tmp[t][j][k] * f[y][p]) % mo;
        }
        tmp[tt][j][k] = (tmp[tt][j][k] + tmp[t][j][k]) % mo;
      }
    memset(tmp[t], 0, sizeof(tmp[t]));
    t ^= 1;
  }
  for (int i = 0; i <= 1; ++i)
    f[x][i] = (tmp[t][i][0] + tmp[t][i][1] * (i == 0 ? 2ll : 1ll) +
               tmp[t][i][2] * 2ll) %
              mo;
  swap(f[x][0], f[x][1]);
  f[x][1]++;
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int x;
    scanf("%d", &x);
    E[x].push_back(i);
  }
  dfs(1);
  printf("%d\n", (f[1][0] + f[1][1]) % mo);
}
