MOD = 998244353 n = int(input()) edges = [[] for _ in range(n)] for _ in range(n - 1): u, v = map(int, input().split()) u -= 1 v -= 1 edges[u].append(v) edges[v].append(u) route = [0] stack = [0] used = [False] * n used[0] = True while stack: pos = stack.pop() for npos in edges[pos]: if used[npos]: continue used[npos] = True stack.append(npos) route.append(npos) used = [False] * n dp0 = [1] * n dp1 = [1] * n for pos in route[::-1]: used[pos] = True for npos in edges[pos]: if not used[npos]: continue d0 = dp0[pos] * (dp0[npos] + dp1[npos]) d1 = dp0[pos] * dp1[npos] + dp1[pos] * (dp0[npos] + dp1[npos]) dp0[pos] = d0 % MOD dp1[pos] = d1 % MOD print(dp1[0])