#include <bits/stdc++.h>
using namespace std;
int n, s;
int a[3200];
struct segtree {
  long long num[12200][3200];
  void init() { memset(num, 0, sizeof(num)); }
  long long query(int x, int l, int r, int ll, int rr, int sum) {
    if (r < ll || l > rr)
      return 0;
    else if (ll <= l && r <= rr) {
      return num[x][sum];
    } else {
      long long ret = 0, ansl, ansr;
      int m = (l + r) / 2;
      for (int i = 1; i < sum; i++) {
        ansl = query(x * 2, l, m, ll, rr, i);
        ansr = query(x * 2 + 1, m + 1, r, ll, rr, sum - i);
        ret = (ret + (ansl * ansr) % 998244353) % 998244353;
      }
      ansl = query(x * 2, l, m, ll, rr, sum);
      ret = (ret + ansl) % 998244353;
      ansr = query(x * 2, m + 1, r, ll, rr, sum);
      ret = (ret + ansr) % 998244353;
      return ret;
    }
  }
  void build(int x, int l, int r) {
    if (l == r) {
      if (a[l] <= s) {
        num[x][a[l]] = 1LL;
      }
      return;
    }
    int m = (l + r) / 2;
    build(x * 2, l, m);
    build(x * 2 + 1, m + 1, r);
    for (int i = 1; i <= s; i++) {
      for (int j = 1; j < i; j++) {
        num[x][i] =
            (num[x][i] + (num[x * 2][j] * num[x * 2 + 1][i - j]) % 998244353) %
            998244353;
      }
      num[x][i] = (num[x][i] + num[x * 2][i]) % 998244353;
      num[x][i] = (num[x][i] + num[x * 2 + 1][i]) % 998244353;
    }
  }
} seg;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> s;
  for (int i = 1; i <= n; i++) cin >> a[i];
  seg.init();
  seg.build(1, 1, n);
  long long ret = 0LL, cand;
  for (int i = 1; i <= n; i++) {
    for (int j = i; j <= n; j++) {
      cand = seg.query(1, 1, n, i, j, s);
      ret = (ret + cand) % 998244353;
    }
  }
  cout << ret << endl;
  return 0;
}
