#include <bits/stdc++.h>
using namespace std;
long long Xr;
char Cr;
inline long long rd() {
  Xr = 0;
  Cr = getchar();
  while (Cr < '0' || Cr > '9') Cr = getchar();
  while (Cr >= '0' && Cr <= '9')
    Xr = (Xr << 1) + (Xr << 3) + Cr - '0', Cr = getchar();
  return Xr;
}
int n, k;
long long ans;
long long va[3005];
long long dp[3005];
int main() {
  n = rd(), k = rd();
  for (int i = 1; i <= n; i++) va[i] = rd();
  dp[0] = 1;
  for (int t = 1; t <= n; t++) {
    for (int i = 1; i <= k; i++) dp[i] = 0;
    for (int i = t; i <= n; i++) {
      for (int j = k; j >= va[i]; j--)
        dp[j] += dp[j - va[i]], dp[j] %= 998244353;
      ans += dp[k];
      ans %= 998244353;
    }
  }
  cout << ans;
}
