#include <bits/stdc++.h>
using namespace std;
const int N = 100 + 5;
const int mod = 998244353;
long long f[N][N][3005];
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);
  for (register int i = 1; i <= n; i++)
    for (register int j = 0; j <= Lim; j++)
      if (a[i] == j || j == 0)
        f[i][i][j] = 1;
      else
        f[i][i][j] = 0;
  for (register int i = 1; i <= n; i++)
    for (register int j = i + 1; j <= n; j++)
      for (register int k = 0; k <= Lim; k++) {
        f[i][j][k] = f[i][j - 1][k];
        if (k - a[j] >= 0) (f[i][j][k] += f[i][j - 1][k - a[j]]) %= mod;
      }
  long long ans = 0ll;
  for (register int i = 1; i <= n; i++)
    for (register int j = i; j <= n; j++) (ans += f[i][j][S]) %= mod;
  printf("%lld\n", ans);
}
