N = int(input()) A = list(map(int,input().split())) P = 998244353 S = sum(A) inv = P - P // 2 C = pow(2,N-1,P) n = 100 * N + 1 dp = [[0] * n for _ in range(N)] dp[0][0] = C dp[0][A[0]] = C for i in range(N-1): for j in range(n): if dp[i][j]: dp[i+1][j] += dp[i][j] * inv % P dp[i+1][j+A[i+1]] += dp[i][j] * inv % P for j in range(n): dp[i+1][j] %= P ans = 0 for i in range(n): ans = (ans + dp[-1][i] * abs(S - 2 * i)) % P print(ans)