#include <bits/stdc++.h>
using namespace std;
const int MM = 1000000007;
vector<int> G[100005];
long long T[100005][2];
int N;
void DFS(int x) {
  long long ans[2] = {0, 1};
  long long D[3] = {1, 0, 1};
  for (int i = 0; i < G[x].size(); i++) {
    long long wi = G[x][i], tmp = ans[0];
    DFS(wi);
    ans[0] = ans[1] * T[wi][1] + ans[0] * T[wi][0];
    ans[1] = tmp * T[wi][1] + ans[1] * T[wi][0];
    ans[0] %= MM;
    ans[1] %= MM;
    D[0] *= T[wi][0];
    tmp = D[1];
    D[1] += D[2] * T[wi][1];
    D[2] += tmp * T[wi][1];
    D[0] %= MM;
    D[1] %= MM;
    D[2] %= MM;
  }
  ans[0] += MM - D[1];
  ans[1] += MM - D[0];
  ans[0] %= MM, ans[1] %= MM;
  T[x][0] = ans[0], T[x][1] = ans[1];
  ans[0] = 0;
  ans[1] = 1;
  for (int i = (int)G[x].size() - 1; i >= 0; i--) {
    long long wi = G[x][i], tmp = ans[0];
    ans[0] = ans[1] * T[wi][1] + ans[0] * T[wi][0];
    ans[1] = tmp * T[wi][1] + ans[1] * T[wi][0];
    ans[0] %= MM;
    ans[1] %= MM;
  }
  ans[0] %= MM, ans[1] %= MM;
  T[x][0] += ans[0], T[x][1] += ans[1];
  T[x][0]++;
  T[x][0] %= MM, T[x][1] %= MM;
}
int main() {
  scanf("%d", &N);
  for (int i = 2; i <= N; i++) {
    int P;
    scanf("%d", &P);
    G[P].push_back(i);
  }
  DFS(1);
  printf("%lld", (T[1][0] + T[1][1] + MM - 1) % MM);
}
