#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long mod = 998244353;
long long n, a[N], co[N], p[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", a + i);
  p[0] = 1;
  for (int i = 1; i <= n; ++i) p[i] = (p[i - 1] * 2LL) % mod;
  co[1] = 1;
  long long ans = a[n];
  for (int i = 2; i <= n; ++i) {
    co[i] = 1LL * (i + 1) * p[i - 2] % mod;
    ans = (ans + co[i] * a[n - i + 1] % mod) % mod;
  }
  printf("%d\n", (int)ans);
  return 0;
}
