def zeta_bit(L0): k = (len(L0) - 1).bit_length() n = 1 << k L = L0[:] + [0] * (n - len(L0)) for i in range(k): for j in range(n): if j >> i & 1: L[j] += L[j^(1<> 1 x ^= x >> 2 x ^= x >> 4 x ^= x >> 8 x ^= x >> 16 return x & 1 P = 998244353 N = int(input()) A = [int(a) for a in input().split()] iS = pow(sum(A), P - 2, P) B = zeta_bit([a * iS % P for a in A]) ans = 0 for i, b in enumerate(B[:-1]): ans += pow(B[-1] - b, P - 2, P) * (1 if popcount_parity(i) else -1) print(ans * (-1) ** N % P)