#include <bits/stdc++.h>
using namespace std;
vector<int> vec[200005];
long long int dp0[200005], dp1[200005], dp2[200005];
void dfs(int v = 0) {
  if (vec[v].size() == 0) {
    dp0[v] = 0;
    dp1[v] = 0;
    dp2[v] = 1;
  } else {
    long long int a = 1, b = 0, c = 0;
    for (int i = 0; i < vec[v].size(); i++) {
      int to = vec[v][i];
      dfs(to);
      long long int na = a * (dp0[to] + dp2[to]) % 998244353;
      long long int nb = (b * (dp0[to] + dp2[to]) % 998244353 +
                          a * (dp1[to] + dp2[to]) % 998244353) %
                         998244353;
      long long int nc =
          (c * ((dp0[to] + dp1[to] + 2LL * dp2[to]) % 998244353) % 998244353 +
           b * (dp1[to] + dp2[to]) % 998244353) %
          998244353;
      a = na, b = nb, c = nc;
    }
    dp0[v] = a, dp1[v] = b, dp2[v] = c;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    int p;
    scanf("%d", &p);
    p--;
    vec[p].push_back(i);
  }
  dfs();
  printf("%lld\n", (dp0[0] + dp2[0]) % 998244353);
  return 0;
}
