#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
bool** dp;
long long n;
long long mod = 998244353;
long long printSubsetsRec(long long arr[], long long i, long long sum,
                          pair<long long, long long> p) {
  long long ans = 0;
  if (i == 0 && sum != 0 && dp[0][sum]) {
    if (i > p.second) p.second = i;
    if (i < p.first) p.first = i;
    return (p.first + 1) * (n - p.second) % mod;
  }
  if (i == 0 && sum == 0) {
    return (p.first + 1) * (n - p.second) % mod;
  }
  if (dp[i - 1][sum]) {
    pair<long long, long long> b = p;
    ans += printSubsetsRec(arr, i - 1, sum, b) % mod, ans %= mod;
  }
  if (sum >= arr[i] && dp[i - 1][sum - arr[i]]) {
    if (i > p.second) p.second = i;
    if (i < p.first) p.first = i;
    ans += printSubsetsRec(arr, i - 1, sum - arr[i], p) % mod, ans %= mod;
  }
  return ans % mod;
}
long long printAllSubsets(long long arr[], long long n, long long sum) {
  if (n == 0 || sum < 0) return 0;
  dp = new bool*[n];
  for (long long i = 0; i < n; ++i) {
    dp[i] = new bool[sum + 1];
    dp[i][0] = true;
  }
  if (arr[0] <= sum) dp[0][arr[0]] = true;
  for (long long i = 1; i < n; ++i)
    for (long long j = 0; j < sum + 1; ++j)
      dp[i][j] =
          (arr[i] <= j) ? dp[i - 1][j] || dp[i - 1][j - arr[i]] : dp[i - 1][j];
  if (dp[n - 1][sum] == false) {
    return 0;
  }
  pair<long long, long long> p;
  p.first = 1000000;
  p.second = -1000000;
  return printSubsetsRec(arr, n - 1, sum, p) % mod;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long k;
  cin >> n >> k;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  cout << printAllSubsets(a, n, k) % mod << endl;
}
