#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int ret = 0, f = 1;
  while (ch > '9' || ch < '0') {
    if (ch == '0') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') ret = ret * 10 + ch - '0', ch = getchar();
  return ret * f;
}
const int mx = 1e6 + 233, mod = 998244353, inv = 499122177;
int n, a[mx], p[mx], q[mx], r[mx], ans;
int main() {
  n = read();
  for (int i = 1; i <= n; i++) a[i] = read();
  p[0] = 1;
  for (int i = 1; i <= n; i++) p[i] = 1ll * p[i - 1] * inv % mod;
  for (int i = 1; i <= n; i++)
    q[i] = 1ll * p[i] * a[i] % mod, r[i] = (r[i - 1] + q[i]) % mod;
  for (int i = 1; i <= n; i++) {
    ans = (ans + r[i - 1]) % mod;
    ans = (ans + 1ll * a[i] * p[i - 1] % mod) % mod;
  }
  for (int i = 1; i <= n - 1; i++) ans = ans * 2 % mod;
  printf("%d\n", ans);
  return 0;
}
