#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e3 + 5, P = 998244353;
int n, S;
int A[MAXN], f[MAXN];
int main() {
  scanf("%d%d", &n, &S);
  for (int i = 1; i <= n; ++i) scanf("%d", A + i);
  int ans = 0;
  for (int i = 1; i <= n; ++i) {
    memset(f, 0, (S + 1) * sizeof(int));
    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]]) % P;
      ans = (ans + f[S]) % P;
    }
  }
  printf("%d\n", ans);
  return 0;
}
