#include <bits/stdc++.h>
using namespace std;
template <class S, class T>
pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first + t.first, s.second + t.second);
}
template <class S, class T>
pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) {
  return pair<S, T>(s.first - t.first, s.second - t.second);
}
template <class S, class T>
ostream &operator<<(ostream &os, pair<S, T> p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
const long long inf = 1000000001;
const long long INF = (long long)1e18 + 1;
const long long MOD = 998244353;
const double pi = 3.14159265358979323846;
int dx[4] = {-1, 0, 1, 0}, dy[4] = {0, 1, 0, -1};
int dx2[8] = {1, 1, 0, -1, -1, -1, 0, 1}, dy2[8] = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> p;
vector<vector<int> > childs;
vector<vector<long long> > dp;
long long mod_pow(long long x, long long p, long long M = MOD) {
  long long a = 1;
  while (p) {
    if (p % 2) a = a * x % M;
    x = x * x % M;
    p /= 2;
  }
  return a;
}
long long mod_inverse(long long a, long long M = MOD) {
  return mod_pow(a, M - 2, M);
}
void dfs(int now, int par) {
  if (childs[now].size() == 0) {
    dp[now][0] = 0;
    dp[now][1] = 0;
    dp[now][2] = 1;
    return;
  }
  long long zen = 1;
  long long mul = 1;
  for (int i = 0; i < (childs[now].size()); i++) {
    int ch = childs[now][i];
    dfs(ch, now);
    (zen *= (dp[ch][0] + dp[ch][1] + dp[ch][2] * 2) % MOD) %= MOD;
    (mul *= (dp[ch][0] + dp[ch][2]) % MOD) %= MOD;
  }
  dp[now][0] = 1;
  dp[now][1] = 0;
  for (int i = 0; i < (childs[now].size()); i++) {
    int ch = childs[now][i];
    (dp[now][0] *= (dp[ch][0] + dp[ch][2]) % MOD) %= MOD;
    (dp[now][1] += (dp[ch][1] + dp[ch][2]) % MOD * mul % MOD *
                   mod_inverse((dp[ch][0] + dp[ch][2]) % MOD) % MOD) %= MOD;
  }
  dp[now][2] = (zen - dp[now][0] - dp[now][1]) % MOD;
  dp[now][2] = (dp[now][2] + MOD) % MOD;
}
int main() {
  int n;
  cin >> n;
  p.resize(n);
  p[0] = -1;
  childs.resize(n);
  for (int u = 1; u <= (n - 1); u++) {
    cin >> p[u];
    p[u]--;
    childs[p[u]].push_back(u);
  }
  for (int i = 0; i < (n); i++) sort(childs[i].begin(), childs[i].end());
  dp.resize(n);
  for (int i = 0; i < (n); i++) dp[i].resize(3);
  dfs(0, -1);
  cout << (dp[0][0] + dp[0][2]) % MOD << endl;
}
