#include <bits/stdc++.h>
using namespace std;
long long MOD = 998244353;
long long n;
vector<vector<long long> > dp;
vector<vector<long long> > g;
void dfs(long long v) {
  if ((long long)g[v].size() == 0) {
    dp[v].push_back(0);
    dp[v].push_back(0);
    dp[v].push_back(1);
  } else {
    dfs(g[v][0]);
    long long a0, a1, a2;
    a0 = dp[g[v][0]][0] + dp[g[v][0]][2];
    a0 %= MOD;
    a1 = dp[g[v][0]][1] + dp[g[v][0]][2];
    a1 %= MOD;
    a2 = 0;
    for (long long j = 1; j < (long long)g[v].size(); j++) {
      dfs(g[v][j]);
      long long n1, n2, n0;
      n0 = a0 * ((dp[g[v][j]][0] + dp[g[v][j]][2]) % MOD);
      n0 %= MOD;
      n1 = (a1 * ((dp[g[v][j]][0] + dp[g[v][j]][2]) % MOD)) % MOD +
           (a0 * ((dp[g[v][j]][1] + dp[g[v][j]][2]) % MOD)) % MOD;
      n1 %= MOD;
      n2 = (a1 * ((dp[g[v][j]][1] + dp[g[v][j]][2]) % MOD)) % MOD +
           (a2 *
            ((dp[g[v][j]][0] + dp[g[v][j]][1] + 2 * dp[g[v][j]][2]) % MOD)) %
               MOD;
      n2 %= MOD;
      a0 = n0;
      a1 = n1;
      a2 = n2;
    }
    dp[v].push_back(a0);
    dp[v].push_back(a1);
    dp[v].push_back(a2);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  g.resize(n);
  dp.resize(n);
  for (long long i = 0; i < n - 1; i++) {
    long long a;
    cin >> a;
    g[a - 1].push_back(i + 1);
  }
  dfs(0);
  cout << (dp[0][0] + dp[0][2]) % MOD << "\n";
  return 0;
}
