#include <bits/stdc++.h>
using namespace std;
long long int ee[112345], eo[112345], oe[112345], oo[112345], to[112345],
    te[112345];
vector<int> child[112345];
void dfs(int u) {
  if (child[u].size() == 0) {
    ee[u] = 1;
    eo[u] = 1;
    oe[u] = 1;
    oo[u] = 1;
    return;
  }
  int n, i, v;
  n = child[u].size();
  sort(child[u].begin(), child[u].end());
  for (i = 0; i < n; i++) {
    v = child[u][i];
    dfs(v);
  }
  to[0] = 1;
  te[0] = 0;
  for (i = 0; i < n; i++) {
    v = child[u][i];
    to[i + 1] = (te[i] * eo[v] + to[i] * oo[v]) % 1000000007;
    te[i + 1] = (te[i] * ee[v] + to[i] * oe[v]) % 1000000007;
  }
  eo[u] = to[n];
  ee[u] = te[n];
  to[n] = 1;
  te[n] = 0;
  for (i = n - 1; i >= 0; i--) {
    v = child[u][i];
    to[i] = (te[i + 1] * eo[v] + to[i + 1] * oo[v]) % 1000000007;
    te[i] = (te[i + 1] * ee[v] + to[i + 1] * oe[v]) % 1000000007;
  }
  eo[u] = (eo[u] + to[0]) % 1000000007;
  ee[u] = (ee[u] + te[0]) % 1000000007;
  to[0] = 0;
  te[0] = 1;
  for (i = 0; i < n; i++) {
    v = child[u][i];
    to[i + 1] = (to[i] + te[i] * oe[v]) % 1000000007;
    te[i + 1] = (te[i] + to[i] * oe[v]) % 1000000007;
  }
  ee[u] -= to[n];
  ee[u]++;
  if (ee[u] < 0) {
    ee[u] += 1000000007;
  }
  to[0] = 1;
  for (i = 0; i < n; i++) {
    v = child[u][i];
    to[i + 1] = (to[i] * oo[v]) % 1000000007;
  }
  eo[u] -= to[n];
  if (eo[u] < 0) {
    eo[u] += 1000000007;
  }
  oe[u] = eo[u];
  oo[u] = ee[u];
  return;
}
int main() {
  int n, i, p;
  cin >> n;
  for (i = 1; i < n; i++) {
    scanf("%d", &p);
    child[p].push_back(i + 1);
  }
  dfs(1);
  cout << (eo[1] + ee[1] + 1000000007 - 1) % 1000000007 << endl;
  return 0;
}
