N=int(input()) A=list(map(int,input().split())) mod=998244353 if N==1: ans=A[0] else: cnt=[None]*N for i in range(N): cnt[i]=pow(2,N-2,mod)*(1+mod)//2*(min(i,N-1-i)+2)*(N+1-min(i,N-1-i))%mod ans=sum(a*c for a,c in zip(A,cnt))%mod print(ans)