#include <bits/stdc++.h>
using namespace std;
using cat = long long;
cat mod = 998244353;
vector<cat> prod1l(300000), prod1r(300000);
void DFS(int R, vector<vector<int> >& son, vector<int>& par,
         vector<pair<cat, cat> >& cnt) {
  if (son[R].empty()) {
    cnt[R] = {1, 1};
    return;
  }
  cat prod0 = 1, prod = 1;
  for (auto it = son[R].begin(); it != son[R].end(); it++) {
    DFS(*it, son, par, cnt);
    prod0 = (prod0 * cnt[*it].second) % mod;
    prod = (prod * (cnt[*it].second + cnt[*it].first)) % mod;
  }
  cnt[R].first = (prod - prod0) % mod;
  int D = son[R].size();
  prod1l[0] = prod1r[D] = 1;
  for (int i = 0; i < D; i++)
    prod1l[i + 1] = prod1l[i] * cnt[son[R][i]].second % mod;
  for (int i = 0; i < D; i++)
    prod1r[D - 1 - i] = prod1r[D - i] * cnt[son[R][D - 1 - i]].second % mod;
  cat sum1 = 0;
  for (int i = 0; i < D; i++)
    sum1 =
        (sum1 + prod1l[i] * prod1r[i + 1] % mod * cnt[son[R][i]].first) % mod;
  cnt[R].second = (prod - sum1) % mod;
}
int main() {
  cin.sync_with_stdio(0);
  cin.tie(0);
  cout << fixed << setprecision(10);
  int N;
  cin >> N;
  vector<int> par(N, 0);
  vector<vector<int> > son(N);
  for (int i = 0; i < N - 1; i++) {
    int p;
    cin >> p;
    par[i + 1] = --p;
    son[p].push_back(i + 1);
  }
  vector<pair<cat, cat> > cnt(N);
  DFS(0, son, par, cnt);
  cnt[0].second %= mod;
  if (cnt[0].second < 0) cnt[0].second += mod;
  cout << cnt[0].second << "\n";
  return 0;
}
