#include <bits/stdc++.h>
using namespace std;
const int N = 212345;
vector<int> c[N];
const int m = 998244353;
int dp[N][2], dp2[N][3];
int solve(vector<pair<int, int>>& v, int t = 2) {
  dp2[0][2] = dp2[0][1] = 0;
  dp2[0][0] = 1;
  for (int i = 1; i <= v.size(); i++) {
    int np, p;
    tie(np, p) = v[i - 1];
    for (int j = 0; j <= 2; j++) {
      dp2[i][j] =
          (1ll * np * dp2[i - 1][j] + 1ll * p * dp2[i - 1][max(0, j - 1)]) % m;
    }
  }
  return dp2[v.size()][t];
}
int go(int u, int x) {
  int& r = dp[u][x];
  if (r != -1) return r;
  r = 1;
  if (x) {
    if (c[u].empty()) return r;
    vector<pair<int, int>> vals;
    for (int v : c[u]) {
      vals.emplace_back(go(v, 0), go(v, 1));
    }
    return r = solve(vals, 1);
  } else {
    for (int v : c[u]) {
      r = (1ll * r * (go(v, 0))) % m;
    }
    vector<pair<int, int>> vals;
    for (int v : c[u]) {
      vals.emplace_back(go(v, 0), go(v, 1));
    }
    r = (r + solve(vals)) % m;
  }
  return r;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  for (int i = 2; i <= n; i++) {
    int p;
    cin >> p;
    c[p].push_back(i);
  }
  memset(dp, -1, sizeof dp);
  cout << go(1, 0) << endl;
  return 0;
}
