#include <bits/stdc++.h>
const int oo = 2139063143;
const int N = 1010000;
const int P = 998244353;
using namespace std;
char buf[1 << 24], *p1 = buf, *p2 = buf, obuf[1 << 23], *O = obuf;
inline void sc(int &x) {
  x = 0;
  static int p;
  p = 1;
  static char c;
  c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
           ? EOF
           : *p1++);
  while (!isdigit(c)) {
    if (c == '-') p = -1;
    c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c - 48);
    c = (p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1 << 21, stdin), p1 == p2)
             ? EOF
             : *p1++);
  }
  x *= p;
}
inline void print(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}
inline void pr(int x) { print(x), putchar('\n'); }
struct EDGE {
  int v, nx;
} lb[N];
int tot = 1, top[N];
void add(int u, int v) { lb[++tot] = (EDGE){v, top[u]}, top[u] = tot; }
int f[N][3];
void dfs(int u) {
  bool fg = 0;
  f[u][0] = 1;
  for (int kb = top[u]; kb != -1; kb = lb[kb].nx) {
    int v = lb[kb].v;
    dfs(v);
    fg = 1;
    f[u][2] =
        ((long long)f[u][2] * ((f[v][0] + f[v][1]) % P + f[v][2] * 2 % P) % P +
         (long long)f[u][1] * (f[v][1] + f[v][2]) % P) %
        P;
    f[u][1] = ((long long)f[u][1] * (f[v][0] + f[v][2]) % P +
               (long long)f[u][0] * (f[v][1] + f[v][2]) % P) %
              P;
    f[u][0] = (long long)f[u][0] * (f[v][0] + f[v][2]) % P;
  }
  if (!fg) f[u][0] = 0, f[u][2] = 1;
}
int main() {
  int n;
  sc(n);
  memset(top, -1, sizeof(int) * (n + 1));
  for (int i = 2; i <= n; i++) {
    int sb;
    sc(sb);
    add(sb, i);
  }
  dfs(1);
  pr((f[1][0] + f[1][2]) % P);
  return 0;
}
