#include <bits/stdc++.h>
using namespace std;
int MOD = 998244353;
int knabsack(vector<int> arr, int b, int s) {
  int n = arr.size() - b;
  int smax = accumulate(arr.begin() + b, arr.end(), 0);
  if (s > smax) return 0;
  vector<vector<int> > dp(n + 1, vector<int>(smax + 1, 0));
  dp[0][0] = 1;
  int sol = 0;
  for (int i = 0; i < n; ++i) {
    for (int ss = 0; ss < smax + 1; ++ss) {
      dp[i + 1][ss] = dp[i][ss];
      int v = ss - arr[b + i];
      if (v >= 0) dp[i + 1][ss] = (dp[i + 1][ss] + dp[i][v]) % MOD;
    }
    sol = (sol + dp[i + 1][s]) % MOD;
  }
  return sol;
}
int main() {
  int n, s;
  cin >> n >> s;
  vector<int> arr(n);
  for (int i = 0; i < n; ++i) cin >> arr[i];
  int sol = 0;
  for (int i = 0; i < n; ++i) sol = (sol + knabsack(arr, i, s)) % MOD;
  cout << sol;
}
