N=int(input()) A=list(map(int,input().split())) mod=998244353 ans=pow(2,N-2,mod)*(N+1)*A[N-1]%mod for i in range(N-1): ans+=pow(2,N-3,mod)*(i+2)*A[i]%mod ans%=mod print(ans)