#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const int MOD = 1e9 + 7;
int n, dp[N][3], p[N];
vector<int> c[N];
void dfs(int);
int _mul(int, int);
int _sum(int a, int b) { return (a + b) >= MOD ? a + b - MOD : a + b; }
template <typename Head, typename... Tail>
int _sum(Head H, Tail... T) {
  return _sum(H, _sum(T...));
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i < n; i++) {
    cin >> p[i];
    p[i]--;
    c[p[i]].push_back(i);
  }
  dfs(0);
  cout << _sum(dp[0][0], dp[0][1]) << endl;
}
void dfs(int v) {
  int child = c[v].size();
  for (int u : c[v]) dfs(u);
  vector<int> zoj(child + 1), fard(child + 1);
  zoj[0] = 1;
  fard[0] = 0;
  int pnt = 1;
  for (int u : c[v]) {
    zoj[pnt] =
        _sum(_mul(zoj[pnt - 1], dp[u][0]), _mul(fard[pnt - 1], dp[u][1]));
    zoj[pnt] = _sum(zoj[pnt], zoj[pnt - 1]);
    fard[pnt] =
        _sum(_mul(fard[pnt - 1], dp[u][0]), _mul(zoj[pnt - 1], dp[u][1]));
    fard[pnt] = _sum(fard[pnt], fard[pnt - 1]);
    pnt++;
  }
  dp[v][0] = zoj.back();
  dp[v][1] = fard.back();
  dp[v][0] = _mul(dp[v][0], 2);
  dp[v][1] = _mul(dp[v][1], 2);
  vector<int> dual(child + 1);
  dual[0] = 1;
  pnt = 1;
  for (int u : c[v]) {
    dual[pnt] = _mul(dp[u][0], dual[pnt - 1]);
    dual[pnt] = _sum(dual[pnt - 1], dual[pnt]);
    pnt++;
  }
  dp[v][0] = _sum(dp[v][0], MOD - dual.back());
  vector<int> t0(child + 1), t1(child + 1);
  t0[0] = 1;
  t1[0] = 0;
  pnt = 1;
  for (int u : c[v]) {
    t0[pnt] = _sum(t0[pnt - 1], _mul(t1[pnt - 1], dp[u][1]));
    t1[pnt] = _sum(t1[pnt - 1], _mul(t0[pnt - 1], dp[u][1]));
    pnt++;
  }
  dp[v][1] = _sum(dp[v][1], MOD - t1.back());
  swap(dp[v][0], dp[v][1]);
  zoj.clear();
  fard.clear();
  dual.clear();
}
int _mul(int a, int b) { return 1LL * a * b % MOD; }
