#include <bits/stdc++.h>
using namespace std;
const long long int mod = 998244353;
long long int solve(int b, int e, int s, vector<long long int> &a) {
  if (e - b == 1) {
    if (a[b] == s)
      return 1;
    else
      return 0;
  }
  int res = 0;
  int mid = (b + e) / 2;
  vector<long long int> dpb(s + 1, 0), dpb_sum(s + 1, 0);
  dpb[0] = 1;
  for (int i = mid - 1; i >= b; i--) {
    for (int j = s; j >= 0; j--) {
      if (j + a[i] <= s) {
        dpb[j + a[i]] += dpb[j];
      }
    }
    for (int j = 0; j <= s; j++) {
      dpb_sum[j] += dpb[j];
    }
  }
  vector<long long int> dpe(s + 1, 0);
  dpe[0] = 1;
  for (int i = mid; i < e; i++) {
    for (int j = s; j >= 0; j--) {
      if (j + a[i] <= s) {
        dpe[j + a[i]] += dpe[j];
      }
    }
    for (int j = 0; j <= s; j++) {
      res += dpb_sum[s - j] * dpe[j] % mod;
    }
  }
  res += solve(b, mid, s, a) + solve(mid, e, s, a);
  res %= mod;
  return res;
}
int main() {
  long long int n, s;
  cin >> n >> s;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  cout << solve(0, n, s, a) << endl;
  return 0;
}
