#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class num>
inline void rd(num &x) {
  char c;
  while (isspace(c = getchar()))
    ;
  bool neg = false;
  if (!isdigit(c))
    neg = (c == '-'), x = 0;
  else
    x = c - '0';
  while (isdigit(c = getchar())) x = (x << 3) + (x << 1) + c - '0';
  if (neg) x = -x;
}
const int MAXN = 3000 + 5, INF = 0x3f3f3f3f;
int a[MAXN];
const int MOD = 998244353;
inline int add(int x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
  return x;
}
inline int sub(int x, int y) {
  x -= y;
  if (x < 0) x += MOD;
  return x;
}
inline int mul(int x, int y) { return long long(x) * y % MOD; }
inline int inv(int x) {
  int y = MOD - 2;
  int ret = 1;
  while (y) {
    if (y & 1) ret = mul(ret, x);
    x = mul(x, x);
    y >>= 1;
  }
  return ret;
}
inline int divi(int x, int y) { return mul(x, inv(y)); }
int n, s;
int main() {
  rd(n);
  rd(s);
  for (int i = 1; i <= n; i++) rd(a[i]);
  int sum = 0;
  for (int l = 1; l <= n; l++) {
    map<int, int> all;
    all[0] = 1;
    int cur = 0;
    for (int r = l; r <= n; r++) {
      ;
      ;
      cur = add(cur, all[s - a[r]]);
      sum = add(sum, cur);
      vector<pair<int, int> > toAdd;
      for (auto p : all) {
        if (p.first + a[r] > s) break;
        toAdd.emplace_back(p.first + a[r], p.second);
      }
      for (auto p : toAdd) {
        all[p.first] = add(all[p.first], p.second);
      }
    }
  }
  printf("%d\n", sum);
}
