N,*A=map(int,open(0).read().split()) M=998244353 r=0 for i in range(N):r+=A[i]*(i+2)*pow(2,N-2,M);r%=M print(r)