MOD = 998244353 N = int(input()) A = list(map(int, input().split())) tot = 0 for i, a in enumerate(A, 1): tot += (i+1) * (N-i+2) * a % MOD print(tot * pow(2, N-4+MOD, MOD) % MOD)