#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int n, S, a[3005], f[3005], ans = 0;
int main() {
  cin >> n >> S;
  for (int i = 1; i <= n; i++) cin >> a[i];
  for (int i = 1; i <= n; i++) {
    memset(f, 0, sizeof(f));
    f[0] = 1;
    for (int j = i; j <= n; j++) {
      for (int k = S; k >= a[j]; k--) f[k] = (f[k] + f[k - a[j]]) % mod;
      ans = (ans + f[S]) % mod;
    }
  }
  cout << ans;
}
