#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
const long long P = 998244353;
const int N = 3000;
long long cnt[N + 5][N + 5], pre[N], ans;
int n, s, a[N + 5];
int main() {
  scanf("%d%d", &n, &s);
  for (int i = (1); i <= (n); i++) scanf("%d", &a[i]);
  cnt[0][0] = 1;
  for (int i = (1); i <= (n); i++) {
    for (int j = (s); j >= (0); j--) {
      cnt[i][j] = cnt[i - 1][j];
      if (j - a[i] >= 0 && cnt[i - 1][j - a[i]])
        cnt[i][j] = (cnt[i][j] + cnt[i - 1][j - a[i]]) % P;
    }
    ans = (ans + cnt[i][s]) % P;
  }
  for (int i = (2); i <= (n); i++) {
    pre[i - 1] = 0;
    for (int j = (0); j <= (s); j++) cnt[i - 1][j] = 0;
    cnt[i - 1][0] = 1;
    long long tmp = 0;
    for (int j = (i); j <= (n); j++) {
      for (int k = (s); k >= (0); k--) {
        cnt[j][k] = cnt[j - 1][k];
        if (k - a[j] >= 0 && cnt[j - 1][k - a[j]])
          cnt[j][k] = (cnt[j][k] + cnt[j - 1][k - a[j]]) % P;
      }
      ans = (ans + cnt[j][s]) % P;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
