#include <bits/stdc++.h>
int n, s, f[3005][3005], a[3005], p[3005], ans;
int main() {
  scanf("%d%d", &n, &s);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), p[i] = p[i - 1] + a[i];
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= s; ++j) f[i - 1][j] = 0;
    for (int j = i; j <= n; ++j) {
      for (int k = 1; k <= s; ++k) f[j][k] = 0;
      f[j][a[j]] = 1;
      for (int k = 1; k <= s; ++k)
        if (k >= a[j])
          f[j][k] += f[j - 1][k] + f[j - 1][k - a[j]];
        else
          f[j][k] += f[j - 1][k];
      ans = (ans + f[j][s]) % 998244353;
    }
  }
  return printf("%d", ans), 0;
}
