#include <bits/stdc++.h>
using namespace std;
const int N = 3e3 + 5;
const int mod = 998244353;
long long f[N];
int a[N], n, S, Lim;
signed main() {
  scanf("%d%d", &n, &S);
  for (register int i = 1; i <= n; i++) scanf("%d", a + i);
  Lim = min(accumulate(a + 1, a + 1 + n, 0), 3000);
  long long ans = 0;
  for (register int i = 1; i <= n; i++) {
    memset(f, 0, sizeof f);
    f[0] = f[a[i]] = 1;
    (ans += f[S]) %= mod;
    for (register int j = i + 1; j <= n; j++) {
      for (register int k = Lim; k >= a[j]; k--) (f[k] += f[k - a[j]]) %= mod;
      (ans += f[S]) %= mod;
    }
  }
  printf("%lld\n", ans);
  return 0;
}
