#include <bits/stdc++.h>
using namespace std;
const int N = 3e5 + 5;
const int mod = 998244353;
int n, fa[N], dp[N][3], pre[N], suf[N];
vector<int> con[N];
namespace MATHEMATICS {
int add(int x, int y) {
  int ret = x + y;
  if (ret >= mod) ret -= mod;
  return ret;
}
int mi(int x, int y) {
  int ret = x - y;
  if (ret < 0) ret += mod;
  return ret;
}
void inc(int &x, int y) {
  x += y;
  if (x >= mod) x -= mod;
}
void dec(int &x, int y) {
  x -= y;
  if (x < 0) x += mod;
}
int mul(int x, int y) { return 1LL * x * y % mod; }
int F_p(int x, int y) {
  int bas = x, ret = 1;
  while (y) {
    if (y & 1) ret = mul(ret, bas);
    bas = mul(bas, bas);
    y >>= 1;
  }
  return ret;
}
}  // namespace MATHEMATICS
using namespace MATHEMATICS;
void init() {
  scanf("%d", &n);
  int i;
  for (i = 2; i <= n; ++i) scanf("%d", &fa[i]);
  for (i = 2; i <= n; ++i) con[fa[i]].push_back(i);
}
void dfs(int x) {
  if (con[x].empty()) {
    dp[x][2] = 1;
    return;
  } else
    dp[x][0] = 1;
  int i, sz = con[x].size(), to;
  int mm = 1, mm2 = 1, nw = 1;
  for (i = 0; i < sz; ++i) {
    to = con[x][i];
    dfs(to);
    pre[to] = nw;
    mm = mul(mm, add(dp[to][0], dp[to][2]));
    mm2 = mul(mm2, add(add(dp[to][0], dp[to][2]), add(dp[to][1], dp[to][2])));
    nw = mul(nw, add(dp[to][0], dp[to][2]));
  }
  dp[x][0] = mm;
  nw = 1;
  for (i = sz - 1; ~i; --i) {
    to = con[x][i];
    suf[to] = nw;
    nw = mul(nw, add(dp[to][0], dp[to][2]));
  }
  for (i = 0; i < sz; ++i) {
    to = con[x][i];
    inc(dp[x][1], mul(add(dp[to][1], dp[to][2]), mul(pre[to], suf[to])));
  }
  dp[x][2] = mi(mm2, add(dp[x][0], dp[x][1]));
}
int main() {
  init();
  dfs(1);
  printf("%d\n", add(dp[1][0], dp[1][2]));
  return 0;
}
