#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
vector<int> children[100007];
long long odd[100007], even[100007];
int N;
int main() {
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    int p;
    scanf("%d", &p);
    children[p].push_back(i);
  }
  for (int i = N; i >= 1; i--) {
    long long o = 0, e = 1ll, ao = 0, ae = 1ll, ev = 1ll;
    for (auto j : children[i]) {
      long long o2 = odd[j] * e + even[j] * o;
      long long e2 = odd[j] * o + even[j] * e;
      long long ao2 = ao + odd[j] * ae;
      long long ae2 = ae + odd[j] * ao;
      ev *= even[j];
      o = o2 % mod;
      e = e2 % mod;
      ao = ao2 % mod;
      ae = ae2 % mod;
      ev %= mod;
    }
    e *= 2ll;
    e -= ev;
    e += mod;
    e %= mod;
    o *= 2ll;
    o -= ao;
    o += mod;
    o %= mod;
    odd[i] = e;
    even[i] = (o + 1ll) % mod;
  }
  printf("%lld\n", (odd[1] + even[1] - 1ll + mod) % mod);
  return 0;
}
