#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
const long long maxn = 3e5 + 5, N = 1e9 + 5, SQ = 320, base = 800287,
                mod = 998244353, INF = 1e18 + 10, lg = 20;
const double eps = 1e-4;
long long n, dp1[maxn], dp2[maxn];
long long pre[maxn], suff[maxn];
vector<long long> edges[maxn];
vector<long long> vec;
void dfs(long long v, long long p = -1) {
  bool leaf = 1;
  for (auto u : edges[v]) {
    if (u != p) {
      dfs(u, v);
      leaf = 0;
    }
  }
  long long bad = 0;
  dp1[v] = dp2[v] = 1;
  pre[0] = suff[0] = 1;
  vec.clear();
  if (leaf) {
    return;
  }
  for (auto u : edges[v]) {
    if (u != p) {
      vec.push_back(u);
      dp2[v] = (dp2[v] * (dp1[u] + dp2[u]) % mod) % mod;
    }
  }
  for (long long i = 0; i < (long long)vec.size(); ++i) {
    pre[i + 1] = (pre[i] * dp1[vec[i]]) % mod;
    suff[i + 1] = (suff[i] * dp1[vec[(long long)vec.size() - i - 1]]) % mod;
  }
  for (long long i = 0; i < (long long)vec.size(); ++i) {
    bad = (bad + (((dp2[vec[i]] * pre[i]) % mod) *
                  suff[(long long)vec.size() - i - 1]) %
                     mod) %
          mod;
  }
  dp1[v] = (dp2[v] - bad + mod) % mod;
  dp2[v] = (dp2[v] - pre[(long long)vec.size()] + mod) % mod;
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (long long i = 1; i < n; ++i) {
    long long x;
    cin >> x;
    x--;
    edges[x].push_back(i);
    edges[i].push_back(x);
  }
  dfs(0);
  cout << dp1[0] << '\n';
}
