#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const int MAXN = 100000;
int N;
long long np[MAXN][2];
vector<int> c[MAXN];
void count(int u) {
  long long ae = np[u][0] = 1, aoe = 1, aoo = 0;
  for (int i = 0; i < ((int)c[u].size()); i++) {
    count(c[u][i]);
    long long ue = np[u][0], uo = np[u][1];
    long long ce = np[c[u][i]][0], co = np[c[u][i]][1];
    np[u][0] += ue * ce + uo * co;
    np[u][0] %= MOD;
    np[u][1] += ue * co + uo * ce;
    np[u][1] %= MOD;
    ae += ae * ce;
    ae %= MOD;
    long long tmp = aoe;
    aoe += aoo * co;
    aoe %= MOD;
    aoo += tmp * co;
    aoo %= MOD;
  }
  np[u][0] *= 2;
  np[u][0] -= ae;
  np[u][0] %= MOD;
  np[u][1] *= 2;
  np[u][1] -= aoo;
  np[u][1] %= MOD;
  np[u][0] ^= np[u][1] ^= np[u][0] ^= np[u][1];
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> N;
  for (int i = 1; i < N; i++) {
    int p;
    cin >> p;
    --p;
    c[p].push_back(i);
  }
  count(0);
  long long res = (np[0][0] + np[0][1]) % MOD;
  if (res < 0) {
    res += MOD;
  }
  cout << res << '\n';
  return 0;
}
