mod = 998244353 n = int(input()) a = [*map(int, input().split())] ans = 0 for i, v in enumerate(a): if i == 0: res = pow(2, n - 2, mod) elif i < n - 1: res = ((i + 2) * pow(2, n - 3, mod)) % mod else: res = ((n + 1) * pow(2, n - 2, mod)) % mod ans = (ans + res * v) % mod print(ans)