#include <bits/stdc++.h>
using namespace std;
vector<vector<long long> > G;
const long long MOD = 998244353;
vector<long long> dp[3];
void dfs(long long v) {
  dp[0][v] = dp[1][v] = dp[2][v] = 0;
  if (G[v].size() == 0) {
    dp[1][v] = 1;
    return;
  }
  dp[0][v] = 1;
  for (long long to : G[v]) {
    long long N[3];
    dfs(to);
    N[2] =
        dp[2][v] * (dp[0][to] + dp[1][to]) + dp[0][v] * (dp[2][to] + dp[1][to]);
    N[1] = (dp[2][v] + dp[1][v]) * (dp[2][to] + dp[1][to]) +
           dp[1][v] * (dp[0][to] + dp[1][to]);
    N[0] = dp[0][v] * (dp[0][to] + dp[1][to]);
    for (long long i = 0; i < 3; i++) dp[i][v] = N[i] % MOD;
  }
}
int main() {
  long long n;
  cin >> n;
  for (long long i = 0; i < 3; i++) {
    dp[i].resize(n);
  }
  G.resize(n);
  for (long long i = 1, a; i < n; i++) {
    cin >> a;
    G[a - 1].push_back(i);
  }
  dfs(0);
  cout << (dp[0][0] + dp[1][0]) % MOD;
}
