#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod = 998244353;
int main() {
  int n, s;
  cin >> n >> s;
  vector<ll> A(n);
  for (int i = 0; i < n; i++) cin >> A[i];
  ll ans = 0;
  for (int i = 0; i < n; i++) {
    vector<ll> sum(s + 1);
    sum[0] = 1;
    for (int j = i; j < n; j++) {
      ll a = A[j];
      for (int k = s - a; k >= 0; k--) {
        sum[k + a] += sum[k];
        sum[k + a] %= mod;
      }
      ans += sum[s];
      ans %= mod;
    }
  }
  cout << ans << endl;
  return 0;
}
