n = int(input()) b = list(map(int,input().split())) mod = 998244353 print(pow(2, b.count(-1), mod) // 2)