#include <bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using pii = std::pair<int, int>;
using pll = std::pair<long long, long long>;
using namespace std;
const long long MOD = 998244353;
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  ll s;
  cin >> n >> s;
  ll* a;
  a = new ll[n];
  for (int i = 0; i < n; ++i) cin >> a[i];
  ll* dp;
  dp = new ll[s + 1];
  ll ans = 0;
  for (int i = 0; i < n; ++i) {
    memset(dp, 0, sizeof(ll) * (s + 1));
    for (int j = i; j < n; ++j) {
      if (j != i) {
        if (a[j] <= s) {
          for (int k = s; k >= a[j] + 1; --k) {
            if (dp[k - a[j]] != 0) dp[k] += dp[k - a[j]];
            dp[k] %= MOD;
          }
          dp[a[j]] += 1;
          dp[a[j]] %= MOD;
        }
      } else {
        if (a[j] <= s) dp[a[j]] = 1;
      }
      ans += dp[s];
      ans %= MOD;
    }
  }
  cout << ans << "\n";
  return 0;
}
