#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
vector<int> a, pref;
int n, s;
int ways(int l, int r, int S) {
  if (S == 0) {
    return 1;
  }
  if (r == l) {
    return 0;
  }
  return ways(l, r - 1, S) + (S >= a[r - 1] ? ways(l, r - 1, S - a[r - 1]) : 0);
}
int main() {
  cin >> n >> s;
  a = vector<int>(n);
  pref = vector<int>(n + 1);
  pref[0] = 0;
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    pref[i + 1] = pref[i] + a[i];
  }
  int ans = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = i; j < n; ++j) {
      ans += ways(i, j + 1, s);
      if (ans >= mod) {
        ans -= mod;
      }
    }
  }
  cout << ans << "\n";
  return 0;
}
