n = int(input()) pos = [] neg = [] mod = 998244353 zero = False a = list(map(int, input().split())) for i in a: if i > 0: pos.append(i) elif i < 0: neg.append(i) else: zero = True ans = pow(2, len(pos)-1, mod)*pow(2, len(neg)-1, mod)*2 % mod if zero: ans *= 3 print(ans % mod)