#include <bits/stdc++.h>
using namespace std;
const int N = 500050;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f3f3f;
const int mod = 998244353;
const int MOD = 1e9 + 7;
const double PI = acos(-1.0);
clock_t TIME__START, TIME__END;
void program_end() {}
long long ksm(long long a, long long b, int mod2 = mod) {
  long long ret = 1;
  while (b) {
    if (b & 1) ret = ret * a % mod2;
    a = a * a % mod2;
    b >>= 1;
  }
  return ret;
}
int add(int a, int b) { return a + b >= mod ? a + b - mod : a + b; }
int sub(int a, int b) { return a - b < 0 ? a - b + mod : a - b; }
int mul(int a, int b) { return 1ll * a * b % mod; }
int n;
int f[N], g[N];
vector<int> e[N];
void dfs(int u) {
  f[u] = g[u] = 1;
  int prodfv = 1;
  for (auto v : e[u]) {
    dfs(v);
    f[u] = mul(f[u], add(f[v], g[v]));
    prodfv = mul(prodfv, f[v]);
  }
  g[u] = f[u];
  if (e[u].empty() == false) {
    for (auto v : e[u])
      f[u] = sub(f[u], mul(mul(prodfv, ksm(f[v], mod - 2)), g[v]));
    g[u] = sub(g[u], prodfv);
  }
}
inline void solve() {
  scanf("%d", &n);
  for (int i = 2; i <= n; ++i) {
    int p;
    scanf("%d", &p);
    e[p].push_back(i);
  }
  dfs(1);
  cout << f[1] << '\n';
}
int main() {
  TIME__START = clock();
  int Test = 1;
  while (Test--) {
    solve();
  }
  TIME__END = clock();
  program_end();
  return 0;
}
