#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
const ll mod = 998244353;
ll modpow(ll a, ll b) {
  ll ans = 1;
  for (; b; b /= 2) {
    if (b & 1) ans = ans * a % mod;
    a = a * a % mod;
  }
  return ans;
}
ll modinv(ll a) { return modpow(a, mod - 2); }
int n;
vector<ll> blank, link, hub;
vector<vector<int>> adj;
void dfs(int v) {
  if (adj[v].empty()) {
    hub[v] = 1;
    return;
  }
  for (int w : adj[v]) dfs(w);
  blank[v] = 1;
  for (int w : adj[v]) {
    blank[v] *= (blank[w] + hub[w]) % mod;
    blank[v] %= mod;
  }
  for (int w : adj[v]) {
    ll x = (link[w] + hub[w]) % mod;
    ll y = (blank[w] + hub[w]) % mod;
    ll z = x * modinv(y) % mod;
    link[v] += z * blank[v] % mod;
    link[v] %= mod;
  }
  hub[v] = 1;
  for (int w : adj[v]) {
    hub[v] *= (blank[w] + 2 * hub[w] + link[w]) % mod;
    hub[v] %= mod;
  }
  hub[v] -= blank[v];
  hub[v] -= link[v];
  hub[v] %= mod;
  if (hub[v] < 0) hub[v] += mod;
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << setprecision(12);
  cin.tie(nullptr);
  cin >> n;
  adj.resize(n);
  for (int v = 1; v < n; v++) {
    int u;
    cin >> u;
    u--;
    ;
    adj[u].push_back(v);
  }
  blank.resize(n);
  link.resize(n);
  hub.resize(n);
  dfs(0);
  cout << (blank[0] + hub[0]) % mod << endl;
}
