mod = 998244353 N = int(input()) C = list(map(int, input().split())) x, y, z = 0, 0, 0 if 0 in C: z += 1 if max(C) > 0: x += 1 if min(C) < 0: y += 1 ans = pow(2, N - x - y - z, mod) * (x + y) * pow(x + y + z, z, mod) % mod if N == 1: ans = 1 print(ans)