#include <bits/stdc++.h>
using namespace std;
const int sz = 3e3 + 5, mod = 998244353;
long long n, s, ans, a[sz], dp[sz][sz];
long long fnc(long long pos, long long rem) {
  if (rem < 0) return 0;
  if (!rem) return n - pos + 1;
  if (pos == n) return 0;
  if (dp[pos][rem] != -1) return dp[pos][rem];
  long long x = fnc(pos + 1, rem - a[pos]);
  long long y = fnc(pos + 1, rem);
  if (rem == s) ans += (pos + 1) * x % mod, ans %= mod;
  return dp[pos][rem] = x + y;
}
int main() {
  cin >> n >> s;
  for (long long i = 0; i < n; i++) scanf("%lld", &a[i]);
  memset(dp, -1, sizeof(dp));
  fnc(0, s);
  cout << ans << endl;
}
