#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
template <class T>
inline void ckmin(T& a, T b) {
  if (b < a) a = b;
}
template <class T>
inline void ckmax(T& a, T b) {
  if (b > a) a = b;
}
template <class T>
inline T sqr(T x) {
  return x * x;
}
template <typename base_type, base_type _MOD>
class IntMod {
 public:
  static const int INVERSE_CACHE_SIZE = (1 << 20);
  static base_type MOD;
  static void set_mod(base_type new_mod) { MOD = new_mod; }
  base_type n;
  IntMod(long long d = 0) { n = (d >= 0 ? d % MOD : (d % MOD + MOD) % MOD); }
  virtual ~IntMod() = default;
  IntMod operator-() const { return build(n == 0 ? 0 : MOD - n); }
  IntMod& operator+=(IntMod a) {
    n = (n >= MOD - a.n ? n - MOD + a.n : n + a.n);
    return *this;
  }
  IntMod& operator-=(IntMod a) {
    n = (n >= a.n) ? n - a.n : n - a.n + MOD;
    return *this;
  }
  IntMod& operator*=(IntMod a) {
    *this = *this * a;
    return *this;
  }
  IntMod& operator/=(IntMod a) {
    *this = *this / a;
    return *this;
  }
  static IntMod build(base_type n) {
    IntMod r;
    r.n = n;
    return r;
  }
  static base_type inverse_cache[INVERSE_CACHE_SIZE];
  static bool inverse_cache_ready;
  friend IntMod inverse(IntMod n) { return build(inverse_internal(n.n)); }
  static base_type inverse_internal(base_type n) {
    if (!inverse_cache_ready) {
      inverse_cache_ready = true;
      inverse_cache[0] = 0;
      inverse_cache[1] = 1;
      for (int n = 2; n < INVERSE_CACHE_SIZE; ++n)
        inverse_cache[n] =
            (MOD -
             (base_type)((long long)inverse_cache[MOD % n] * (MOD / n) % MOD));
    }
    return n < INVERSE_CACHE_SIZE
               ? inverse_cache[n]
               : MOD - (base_type)((long long)inverse_internal(MOD % n) *
                                   (MOD / n) % MOD);
  }
  friend bool operator==(IntMod a, IntMod b) { return a.n == b.n; }
  friend bool operator!=(IntMod a, IntMod b) { return a.n != b.n; }
  friend IntMod operator+(IntMod a, IntMod b) {
    return build(a.n >= MOD - b.n ? a.n - MOD + b.n : a.n + b.n);
  }
  friend IntMod operator-(IntMod a, IntMod b) {
    return build(a.n >= b.n ? a.n - b.n : a.n - b.n + MOD);
  }
  friend IntMod operator*(IntMod a, IntMod b) {
    return build(
        static_cast<base_type>(static_cast<long long>(a.n) * b.n % MOD));
  }
  friend IntMod operator/(IntMod a, IntMod b) { return a * inverse(b); }
  friend IntMod pow(IntMod p, long long e) {
    if (e <= 0) return IntMod(1);
    IntMod r = IntMod(1);
    while (1) {
      if (e & 1) r *= p;
      e /= 2;
      if (e)
        p = p * p;
      else
        break;
    }
    return r;
  }
};
template <typename base_type, base_type _MOD>
base_type IntMod<base_type, _MOD>::inverse_cache[INVERSE_CACHE_SIZE];
template <typename base_type, base_type _MOD>
bool IntMod<base_type, _MOD>::inverse_cache_ready;
template <typename base_type, base_type _MOD>
base_type IntMod<base_type, _MOD>::MOD = _MOD;
using Int = IntMod<int, (998244353)>;
const int maxn = (1 << 20);
int n;
vector<int> g[maxn];
vector<Int> solve(int p) {
  if (((int)g[p].size()) == 0) return {0, 1, 0};
  Int r0 = 1;
  vector<vector<Int>> w;
  for (int c : g[p]) w.push_back(solve(c));
  for (auto c : w) r0 *= (c[0] + c[1]);
  Int f[3];
  f[0] = 1;
  f[1] = f[2] = 0;
  for (auto c : w) {
    Int e0 = c[0] + c[1];
    Int e1 = c[1] + c[2];
    f[2] = (f[1] + f[2]) * e1 + f[2] * e0;
    f[1] = f[0] * e1 + f[1] * e0;
    f[0] = f[0] * e0;
  }
  return {r0, f[2], f[1]};
}
int main() {
  std::ios::sync_with_stdio(false);
  while (cin >> n) {
    for (int i = 0; i < (n); ++i) g[i].clear();
    vector<int> p(n, -1);
    for (int i = (1); i < (n); ++i) {
      cin >> p[i];
      --p[i];
      g[p[i]].push_back(i);
    }
    auto ret = solve(0);
    int ret2 = (ret[0] + ret[1]).n;
    printf("%d\n", ret2);
    break;
  }
  return 0;
}
