#include <bits/stdc++.h>
using namespace std;
const int INF = 0x7FFFFFFF;
const int MAXN = 131072;
const long long MOD = 1000000007;
long long even[MAXN];
long long odd[MAXN];
vector<int> ve[MAXN];
void calc(int v) {
  even[v] = 0;
  odd[v] = 1;
  long long onlyEven = 1;
  long long onlyOdd0 = 1;
  long long onlyOdd1 = 0;
  for (int c : ve[v]) {
    long long neven = even[v] + even[v] * even[c] % MOD + odd[v] * odd[c] % MOD;
    long long nodd = odd[v] + even[v] * odd[c] % MOD + odd[v] * even[c] % MOD;
    even[v] = neven % MOD;
    odd[v] = nodd % MOD;
    onlyEven = onlyEven * (1 + even[c]) % MOD;
    long long no0 = onlyOdd0 + onlyOdd1 * odd[c] % MOD;
    long long no1 = onlyOdd1 + onlyOdd0 * odd[c] % MOD;
    onlyOdd0 = no0 % MOD;
    onlyOdd1 = no1 % MOD;
  }
  even[v] = (even[v] * 2 + MOD - onlyOdd1) % MOD;
  odd[v] = (odd[v] * 2 + MOD - onlyEven) % MOD;
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (1); i < (n); i++) {
    int p;
    scanf("%d", &p);
    ve[p - 1].push_back(i);
  }
  for (int i = (n)-1; i >= 0; i--) calc(i);
  printf("%d", int((even[0] + odd[0]) % MOD));
  return 0;
}
