#include <bits/stdc++.h>
using namespace std;
inline long long mod(long long n, long long m) {
  long long ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
long long exp(long long a, long long b, long long m) {
  if (b == 0) return 1;
  if (b == 1) return mod(a, m);
  long long k = mod(exp(a, b / 2, m), m);
  if (b & 1) {
    return mod(a * mod(k * k, m), m);
  } else
    return mod(k * k, m);
}
const long long M = 998244353;
long long a[3010];
long long cnt[3010][3010];
long long n, s;
long long res = 0;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n >> s;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  cnt[0][0] = 1;
  for (long long ini = 1; ini <= n; ini++) {
    for (long long i = 1; i <= n; i++) {
      for (long long j = 0; j <= s; j++) cnt[i][j] = 0;
    }
    cnt[ini - 1][0] = 1;
    for (long long i = ini; i <= n; i++) {
      for (long long j = s; j >= 0; j--) {
        cnt[i][j] = mod(cnt[i][j] + cnt[i - 1][j], M);
        if (j + a[i] <= s)
          cnt[i][j + a[i]] = mod(cnt[i][j + a[i]] + cnt[i - 1][j], M);
      }
      res = mod(res + cnt[i][s], M);
    }
  }
  cout << res << "\n";
}
