#include <bits/stdc++.h>
using namespace std;
struct md {
  int v;
  md(int _v = 0) { v = _v; }
  void operator+=(md a) { v = (0LL + v + a.v) % 1000000007; }
  void operator-=(md a) { v = (0LL + v - a.v + 1000000007) % 1000000007; }
  void operator*=(md a) { v = (1LL * v * a.v) % 1000000007; }
};
md operator+(md a, md b) { return (0LL + a.v + b.v) % 1000000007; }
md operator-(md a, md b) { return (0LL + a.v - b.v + 1000000007) % 1000000007; }
md operator*(md a, md b) { return (1LL * a.v * b.v) % 1000000007; }
vector<int> edges[100005];
md dp[100005][2];
void dfs(int u) {
  md tmp[2];
  tmp[0] = 1;
  tmp[1] = 0;
  for (auto v : edges[u]) {
    dfs(v);
    md tt[2];
    tt[0] = tmp[0] * (dp[v][0] + 1) + tmp[1] * dp[v][1];
    tt[1] = tmp[1] * (dp[v][0] + 1) + tmp[0] * dp[v][1];
    memcpy(tmp, tt, sizeof(tt));
  }
  tmp[0] *= 2;
  tmp[1] *= 2;
  md zero = 1;
  for (auto v : edges[u]) zero *= (dp[v][0] + 1);
  tmp[0] -= zero;
  int e = edges[u].size();
  md one[2];
  one[0] = 1;
  one[1] = 0;
  for (auto v : edges[u]) {
    md tone[2];
    tone[0] = one[1] * dp[v][1] + one[0];
    tone[1] = one[0] * dp[v][1] + one[1];
    memcpy(one, tone, sizeof(tone));
  }
  tmp[1] -= one[1];
  swap(tmp[0], tmp[1]);
  memcpy(dp[u], tmp, sizeof(tmp));
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = (2); i <= (n); i++) {
    int p;
    scanf("%d", &p);
    edges[p].push_back(i);
  }
  for (int i = (1); i <= (n); i++) sort(edges[i].begin(), edges[i].end());
  dfs(1);
  printf("%d\n", (dp[1][0] + dp[1][1]).v);
  return 0;
}
