import sys input = sys.stdin.readline N = int(input()) mod = 998244353 e = [[] for _ in range(N + 1)] for x in range(2, N + 1): p = int(input()) e[p].append(x) s = [1] vis = [0] * (N + 1) parent = [0] * (N + 1) vis[1] = 1 order = [] while len(s): x = s.pop() order.append(x) for y in e[x]: if vis[y]: continue parent[y] = x vis[y] = 1 s.append(y) order.reverse() dp = [1] * (N + 1) for x in order: for y in e[x]: if parent[x] == y: continue dp[x] *= dp[y] dp[x] %= mod if parent[x] > 1: dp[x] += 1 dp[x] %= mod print(dp[1])