#include <bits/stdc++.h>
using namespace std;
int read() {
  int x = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') ch = getchar();
  while (ch >= '0' && ch <= '9') x = x * 10 + (ch ^ 48), ch = getchar();
  return x;
}
int n, fa[200005];
long long f[200005], g[200005], ff[200005], gg[200005];
bool vis[200005];
int main() {
  n = read();
  gg[1] = f[1] = 1;
  for (int i = 2; i <= n; ++i) gg[i] = f[i] = vis[fa[i] = read()] = 1;
  for (int i = n; i; --i) {
    if (!vis[i])
      g[i] = 1;
    else {
      g[i] = f[i];
      if ((f[i] -= ff[i]) < 0) f[i] += 998244353;
      if ((g[i] -= gg[i]) < 0) g[i] += 998244353;
    }
    ff[fa[i]] = (ff[fa[i]] * f[i] + gg[fa[i]] * g[i]) % 998244353;
    gg[fa[i]] = gg[fa[i]] * f[i] % 998244353;
    f[fa[i]] = f[fa[i]] * (f[i] + g[i]) % 998244353;
  }
  printf("%lld\n", f[1]);
  return 0;
}
