#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 998244353;
int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int N, S;
  cin >> N >> S;
  vector<ll> A(N);
  for (auto& a : A) cin >> a;
  ll ans = 0;
  for (int i = 0; i < N; i++) {
    vector<ll> dp(S + 1);
    dp[0] = 1;
    for (int j = i; j < N; j++) {
      for (ll s = S; s >= 0; s--) {
        auto a = A[j];
        if (s + a <= S) {
          dp[s + a] += dp[s];
          dp[s + a] %= MOD;
        }
      }
      ans += dp[S];
      ans %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
