#include <bits/stdc++.h>
template <typename T>
void scan(T &x) {
  x = 0;
  bool _ = 0;
  T c = getchar_unlocked();
  _ = c == 45;
  c = _ ? getchar_unlocked() : c;
  while (c < 48 || c > 57) c = getchar_unlocked();
  for (; c < 48 || c > 57; c = getchar_unlocked())
    ;
  for (; c > 47 && c < 58; c = getchar_unlocked())
    x = (x << 3) + (x << 1) + (c & 15);
  x = _ ? -x : x;
}
template <typename T>
void printn(T n) {
  bool _ = 0;
  _ = n < 0;
  n = _ ? -n : n;
  char snum[65];
  int i = 0;
  do {
    snum[i++] = n % 10 + 48;
    n /= 10;
  } while (n);
  --i;
  if (_) putchar_unlocked(45);
  while (i >= 0) putchar_unlocked(snum[i--]);
}
template <typename First, typename... Ints>
void scan(First &arg, Ints &...rest) {
  scan(arg);
  scan(rest...);
}
template <typename T>
void print(T n) {
  printn(n);
  putchar_unlocked(10);
}
template <typename First, typename... Ints>
void print(First arg, Ints... rest) {
  printn(arg);
  putchar_unlocked(32);
  print(rest...);
}
using namespace std;
using ll = long long;
const int MM = 3005;
ll mod = 998244353, ans;
int n, a[MM], s, dpl[MM], dpr[MM], psl[MM], psr[MM];
void go(int l, int r) {
  if (l == r) {
    if (a[l] == s) ans++;
    ans %= mod;
    return;
  }
  int m = (l + r) / 2;
  for (int j = 0; j < MM; j++) dpl[j] = psl[j] = dpr[j] = psr[j] = 0;
  dpl[0] = dpr[0] = 1;
  for (int i = m; i >= l; i--) {
    for (int j = 3000; j >= 0; j--) {
      if (j >= a[i]) {
        dpl[j] += dpl[j - a[i]];
        dpl[j] %= mod;
      }
      psl[j] += dpl[j];
      psl[j] %= mod;
    }
  }
  for (int i = m + 1; i <= r; i++) {
    for (int j = 3000; j >= 0; j--) {
      if (j >= a[i]) {
        dpr[j] += dpr[j - a[i]];
        dpr[j] %= mod;
      }
      psr[j] += dpr[j];
      psr[j] %= mod;
    }
  }
  for (int i = 0; i <= s; i++) {
    ans += psl[i] * psr[s - i];
    ans %= mod;
  }
  go(l, m);
  go(m + 1, r);
}
int main() {
  scan(n, s);
  for (int i = 0; i < n; i++) {
    scan(a[i]);
  }
  go(0, n - 1);
  print(ans);
  return 0;
}
