#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
inline int read() {
  int w = 1, s = 0;
  char ch = getchar();
  while (!isdigit(ch)) {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (isdigit(ch)) {
    s = s * 10 + ch - '0';
    ch = getchar();
  }
  return w * s;
}
struct node {
  int to, next;
} e[1010010];
int tot, h[1000100], n, f[1001010][3];
inline long long ksm(long long x, long long y) {
  long long res = 1;
  while (y) {
    if (y & 1) res = res * x % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return res;
}
inline void add(int from, int to) {
  e[++tot].next = h[from];
  h[from] = tot;
  e[tot].to = to;
}
inline int pls(int a, int b) {
  a += b;
  return a >= mod ? a - mod : a;
}
inline int mns(int a, int b) {
  a -= b;
  return a < 0 ? a + mod : a;
}
inline void DFS(int now, int ffa) {
  int fl = 0;
  for (register int i = h[now]; i; i = e[i].next) {
    int to = e[i].to;
    if (to == ffa) continue;
    DFS(to, now);
    fl = 1;
  }
  if (!fl)
    f[now][2] = f[now][1] = 1;
  else {
    f[now][0] = 1;
    for (register int i = h[now]; i; i = e[i].next) {
      int to = e[i].to;
      if (to == ffa) continue;
      f[now][0] = 1ll * f[now][0] * pls(f[to][0], f[to][2]) % mod;
    }
    f[now][1] = 0;
    for (register int i = h[now]; i; i = e[i].next) {
      int to = e[i].to;
      if (to == ffa) continue;
      f[now][1] = pls(f[now][1], 1ll * f[now][0] *
                                     ksm(pls(f[to][0], f[to][2]), mod - 2) %
                                     mod * f[to][1] % mod);
    }
    f[now][2] = 0;
    int f1 = 1;
    for (register int i = h[now]; i; i = e[i].next) {
      int to = e[i].to;
      if (to == ffa) continue;
      f1 = (1ll * f1 * f[to][1] % mod +
            1ll * f1 * pls(f[to][0], f[to][2]) % mod) %
           mod;
    }
    f[now][2] = mns(f1, pls(f[now][0], f[now][1]));
    f[now][1] = pls(f[now][1], f[now][2]);
  }
}
int main() {
  n = read();
  for (register int i = 2; i <= n; ++i) {
    int x = read();
    add(x, i);
  }
  DFS(1, 0);
  cout << pls(f[1][0], f[1][2]);
  return 0;
}
