#include <bits/stdc++.h>
using namespace std;
const int MOD = 998244253;
int N, S;
vector<int> v;
long long cache[3005][3005];
long long solve(int pos, int k) {
  if (k == 0) return N - pos + 1;
  if (pos >= N) return 0;
  if (k < 0) return 0;
  long long& ret = cache[pos][k];
  if (ret != -1) return ret;
  ret = solve(pos + 1, k) % MOD;
  ret = (ret + solve(pos + 1, k - v[pos]) % MOD) % MOD;
  return ret;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> N >> S;
  v.resize(N);
  for (int i = 0; i < N; i++) cin >> v[i];
  long long ans = 0;
  memset(cache, -1, sizeof(cache));
  for (int i = 0; i < N; i++) ans = (ans + solve(i, S)) % MOD;
  cout << ans << "\n";
  return 0;
}
