#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int C = 100001, M = 1000000007;
int p[C];
ll dp[C][2], tmp_dp[2], single_way_o[C][2], res[C][2];
vector<vector<int> > sons(C);
int main() {
  int n, i, j, a;
  ll tmp, single_way_e;
  scanf("%d", &n);
  for (i = 2; i <= n; i++) {
    scanf("%d", &p[i]);
    sons[p[i]].push_back(i);
  }
  for (i = n; i >= 1; i--) {
    dp[i][1] = 1;
    single_way_o[i][0] = 1;
    single_way_e = 1;
    for (j = 0; j < sons[i].size(); j++) {
      a = sons[i][j];
      tmp_dp[0] = dp[i][0];
      tmp_dp[1] = dp[i][1];
      tmp_dp[0] = (dp[i][1] * res[a][1] + dp[i][0] * res[a][0] + dp[i][0]) % M;
      tmp_dp[1] = (res[a][1] * dp[i][0] + dp[i][1] * res[a][0] + dp[i][1]) % M;
      dp[i][0] = tmp_dp[0];
      dp[i][1] = tmp_dp[1];
      tmp = single_way_o[i][1];
      single_way_o[i][1] =
          (single_way_o[i][0] * res[a][1] + single_way_o[i][1]) % M;
      single_way_o[i][0] = (tmp * res[a][1] + single_way_o[i][0]) % M;
      single_way_e = (single_way_e * (res[a][0] + 1)) % M;
    }
    res[i][0] = (2 * dp[i][0] - single_way_o[i][1]) % M;
    res[i][1] = (2 * dp[i][1] - 1 - (single_way_e - 1)) % M;
  }
  ll r = (res[1][0] + res[1][1]) % M;
  if (r < 0) r += M;
  printf("%lld\n", r);
  return 0;
}
