#include <bits/stdc++.h>
using namespace std;
using ii = pair<int, int>;
using vi = vector<int>;
using vii = vector<ii>;
using vvi = vector<vi>;
using ll = long long int;
const int MOD = 998244353;
bool res() {
  ll n, s;
  cin >> n >> s;
  if (!cin) return false;
  vi v(n);
  for (int i = 0; i < n; ++i) cin >> v[i];
  ll res = 0;
  for (int ini = 0; ini < n; ++ini) {
    map<int, int> kn;
    kn[0] = 1;
    for (ll j = ini; j < n; ++j) {
      for (auto it = kn.rbegin(); it != kn.rend(); ++it) {
        if (it->first + v[j] <= s) {
          if (kn.find(it->first + v[j]) == kn.end())
            kn.insert(make_pair(it->first + v[j], 0));
          kn[it->first + v[j]] += kn[it->first];
          if (it->first + v[j] == s) {
            res = (res + (n - j) * kn[it->first]) % MOD;
          }
        }
      }
    }
  }
  cout << res << '\n';
  return true;
}
int main() {
  while (res()) {
  }
  return 0;
}
