M = 998244353 n = int(input()) a = map(int, input().split()) print(sum((i + 2) * x for i, x in enumerate(a)) * pow(2, n - 2, M) % M)