#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
using ll = long long;
using P = pair<int, int>;
using T = tuple<int, int, int>;
template <class T>
inline T chmax(T &a, const T b) {
  return a = (a < b) ? b : a;
}
template <class T>
inline T chmin(T &a, const T b) {
  return a = (a > b) ? b : a;
}
constexpr int MOD = 998244353;
constexpr int inf = 1e9;
constexpr long long INF = 1e18;
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, s;
  cin >> n >> s;
  vector<int> a(n);
  for (int i = 0; i < n; i++) cin >> a[i];
  ll ans = 0;
  for (int l = 0; l < n; l++) {
    for (int r = l; r < n; r++) {
      vector<vector<ll>> dp(n + 1, vector<ll>(s + 1, 0));
      dp[l][0] = 1;
      for (int i = l; i <= r; i++) {
        for (int j = 0; j <= s; j++) {
          dp[i + 1][j] += dp[i][j];
          dp[i + 1][j] %= MOD;
          if (j >= a[i]) {
            dp[i + 1][j] += dp[i][j - a[i]];
            dp[i + 1][j] %= MOD;
          }
        }
      }
      ans += dp[r + 1][s];
      ans %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}
