n = int(input()) a = list(map(int, input().split())) if n == 1: exit(print(a[0])) mod = 998244353 print(pow(2, n - 2, mod) * sum((i + 2) * a[i] for i in range(n)) % mod)