#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e5 + 7;
const int P = 998244353;
int ccnt, home[MAXN], nxt[MAXN], to[MAXN];
int n, fa[MAXN];
inline void ct(int x, int y) {
  ccnt++;
  nxt[ccnt] = home[x];
  to[ccnt] = y;
  home[x] = ccnt;
}
long long f[MAXN][3], siz[MAXN];
inline void dfs(int u) {
  f[u][0] = 1;
  siz[u] = 1;
  for (int i = home[u]; i; i = nxt[i]) {
    int v = to[i];
    dfs(v);
    f[u][2] = f[u][2] * (2 * f[v][2] + f[v][0] + f[v][1]) % P +
              f[u][1] * (f[v][1] + f[v][2]) % P;
    f[u][1] =
        f[u][1] * (f[v][2] + f[v][0]) % P + f[u][0] * (f[v][1] + f[v][2]) % P;
    f[u][0] = f[u][0] * (f[v][2] + f[v][0]) % P;
    siz[u] += siz[v];
    f[u][1] %= P;
    f[u][2] %= P;
  }
  if (siz[u] == 1) f[u][2] = 1, f[u][0] = 0;
  return;
}
int main() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    scanf("%d", &fa[i]);
    ct(fa[i], i);
  }
  dfs(1);
  printf("%lld\n", (f[1][0] + f[1][2]) % P);
  return 0;
}
