N=int(input()) A=list(map(int,input().split())) mod=998244353 FACT=[1] for i in range(1,2*10**5+1): FACT.append(FACT[-1]*i%mod) FACT_INV=[pow(FACT[-1],mod-2,mod)] for i in range(2*10**5,0,-1): FACT_INV.append(FACT_INV[-1]*i%mod) FACT_INV.reverse() def Combi(a,b): if 0<=b<=a: return FACT[a]*FACT_INV[b]%mod*FACT_INV[a-b]%mod else: return 0 score=0 k=N-1 for i in range(k+1): score=(score+(i+1)*Combi(k,i))%mod X=pow(2,k-1,mod) INV=pow(2,mod-2,mod) ANS=score*A[-1]%mod #print(ANS) now=2 for i in range(N-1): ANS=(ANS+now*X*A[i]*INV)%mod #print(now*X*INV%mod) now+=1 print(ANS%mod)