#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 10;
const int mod = 998244353;
const double eps = 1e-6;
long long n, s;
long long a[maxn];
long long power(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    b >>= 1;
    a = a * a % mod;
  }
  return res;
}
int main() {
  long long ans = 0;
  cin >> n >> s;
  for (int i = 1; i <= n; i++) cin >> a[i];
  long long res = a[1];
  for (int l = 1, r = 1; l <= n; l++) {
    while (res < s) {
      r++;
      if (r > n) break;
      res += a[r];
    }
    if (res == s) {
      ans = (ans + power(2, n - (r - l + 1))) % mod;
      if (r < n) {
        r++;
        res += a[l];
      }
    }
    res -= a[l];
  }
  cout << ans << endl;
  return 0;
}
