#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353;
vector<vector<vector<long long> > > mem_partitions;
long long partitions(const vector<vector<int> >& ch, int u, int con, int dis) {
  assert(con == 0 || con == 1);
  assert(dis == 0 || dis == 1);
  assert(!(con == 0 && dis == 0));
  long long& ret = mem_partitions[u][con][dis];
  if (ret >= 0) return ret;
  if (ch[u].size() == 0) {
    if (con == 1 && dis == 1) return ret = 1;
    return ret = 0;
  }
  vector<long long> con_par(ch[u].size(), -1);
  vector<long long> dis_par(ch[u].size(), -1);
  for (int i = 0; i < int(ch[u].size()); ++i) {
    int v = ch[u][i];
    con_par[i] = (partitions(ch, v, 1, 0) + partitions(ch, v, 1, 1)) % P;
    dis_par[i] = (partitions(ch, v, 0, 1) + partitions(ch, v, 1, 1)) % P;
  }
  if (con == 0 && dis == 1) {
    long long r0 = 1;
    for (int i = int(ch[u].size()) - 1; i >= 0; --i) {
      r0 = (r0 * dis_par[i]) % P;
    }
    return ret = r0;
  } else if (con == 1 && dis == 0) {
    long long r0 = 1;
    long long r1 = 0;
    for (int i = int(ch[u].size()) - 1; i >= 0; --i) {
      r1 = (r1 * dis_par[i]) % P;
      r1 = (r1 + con_par[i] * r0) % P;
      r0 = (r0 * dis_par[i]) % P;
    }
    return ret = r1;
  } else {
    assert(con == 1 && dis == 1);
    long long r0 = 1;
    long long r1 = 0;
    long long r2 = 0;
    for (int i = int(ch[u].size()) - 1; i >= 0; --i) {
      r2 = (r2 * (con_par[i] + dis_par[i])) % P;
      r2 = (r2 + con_par[i] * r1) % P;
      r1 = (r1 * dis_par[i]) % P;
      r1 = (r1 + con_par[i] * r0) % P;
      r0 = (r0 * dis_par[i]) % P;
    }
    return ret = r2;
  }
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int n;
  cin >> n;
  vector<vector<int> > children(n);
  for (int i = 0; i < n - 1; ++i) {
    int parent;
    cin >> parent;
    --parent;
    children[parent].push_back(i + 1);
  }
  mem_partitions = vector<vector<vector<long long> > >(
      n, vector<vector<long long> >(2, vector<long long>(2, -1)));
  long long ans = 0;
  for (int con = 0; con < 2; ++con) {
    ans = (ans + partitions(children, 0, con, 1)) % P;
  }
  cout << ans << endl;
}
