#include <bits/stdc++.h>
using namespace std;
const long long P = 998244353;
const int maxn = 3e3 + 5;
int n, sum, ar[maxn], f[maxn];
int add(int x, int y) {
  x += y;
  if (x >= P) x -= P;
  return x;
}
int calc_dp(int *ar, int n) {
  memset(f, 0, sizeof(f));
  f[0] = 1;
  int ans = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = sum; j >= ar[i]; j--) {
      f[j] = add(f[j], f[j - ar[i]]);
    }
    ans = add(ans, f[sum]);
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &sum);
  for (int i = 1; i <= n; i++) scanf("%d", &ar[i]);
  int ans = 0;
  for (int i = 1; i <= n; i++) ans = add(ans, calc_dp(ar + i - 1, n - i + 1));
  printf("%d\n", ans);
}
