#include <bits/stdc++.h>
using namespace std;
int p[400400];
long long s1[400400];
long long c1[400400];
long long c2[400400];
long long arr[400400];
long long *pref;
long long suf[400400];
long long *pref2;
long long suf2[400400];
long long arr2[400400];
vector<int> L[400400];
void go(int vx) {
  if (L[vx].size() == 0) {
    c1[vx] = s1[vx] = 1;
    c2[vx] = 0;
    return;
  }
  for (int i = 0; i < L[vx].size(); i++) go(L[vx][i]);
  pref[-1] = 1;
  for (int i = 0; i < L[vx].size(); i++)
    pref[i] = (pref[i - 1] * s1[L[vx][i]]) % 998244353;
  pref2[-1] = 1;
  for (int i = 0; i < L[vx].size(); i++)
    pref2[i] = (pref2[i - 1] * (s1[L[vx][i]] + c2[L[vx][i]])) % 998244353;
  suf[L[vx].size()] = 1;
  for (int i = L[vx].size() - 1; i >= 0; i--)
    suf[i] = (suf[i + 1] * s1[L[vx][i]]) % 998244353;
  s1[vx] = 1;
  for (int i = 0; i < L[vx].size(); i++) {
    int to = L[vx][i];
    s1[vx] = (s1[vx] * (s1[to] + c2[to])) % 998244353;
  }
  suf2[L[vx].size()] = 1;
  for (int i = L[vx].size() - 1; i >= 0; i--)
    suf2[i] = (suf2[i + 1] * (s1[L[vx][i]] + c2[L[vx][i]])) % 998244353;
  c1[vx] = 0;
  for (int i = 0; i < L[vx].size(); i++) {
    int to = L[vx][i];
    long long pi = pref2[i - 1] * suf2[i + 1];
    pi %= 998244353;
    pi *= (c1[to] + c2[to]);
    pi %= 998244353;
    c1[vx] += pi;
    c1[vx] %= 998244353;
  }
  c2[vx] = 1;
  long long tira = 1;
  long long ti2 = 0;
  for (int i = 0; i < L[vx].size(); i++) {
    int to = L[vx][i];
    c2[vx] *= (c1[to] + s1[to] + 2 * c2[to]);
    c2[vx] %= 998244353;
    tira *= (s1[to] + c2[to]);
    tira %= 998244353;
    long long pi = pref2[i - 1] * suf2[i + 1];
    pi %= 998244353;
    pi *= (c1[to] + c2[to]);
    pi %= 998244353;
    ("+= %lld * %lld\n", pref2[i - 1] * suf2[i + 1], c1[to] + c2[to]);
    ti2 += pi;
    ti2 %= 998244353;
  }
  ("vx %d tira %lld ti2 %lld\n", vx, tira, ti2);
  c2[vx] -= (tira + ti2);
  c2[vx] %= 998244353;
  c2[vx] += 998244353;
  c2[vx] %= 998244353;
  ("vx %d c2 %lld c1 %lld s1 %lld\n", vx, c2[vx], c1[vx], s1[vx]);
}
int main() {
  pref = &arr[1];
  pref2 = &arr2[1];
  int n;
  scanf("%d", &n);
  for (int i = 1; i < n; i++) {
    scanf("%d", p + i);
    p[i]--;
    L[p[i]].push_back(i);
  }
  go(0);
  long long ans = c2[0] + s1[0];
  ans %= 998244353;
  printf("%lld\n", ans);
}
