#include <bits/stdc++.h>
using namespace std;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long N, S;
  cin >> N >> S;
  vector<long long> A(N);
  long long ans = 0;
  for (long long i = 0; i < N; i++) {
    cin >> A[i];
    if (S == A[i]) ans++;
  }
  long long dp[3010][3010] = {0};
  dp[0][0] = 1;
  for (long long i = (0); i <= (N); ++i) {
    for (long long j = (0); j <= (S); ++j) {
      dp[i][j] += dp[i - 1][j];
      dp[i][j] %= 998244353;
      if (j - A[i - 1] >= 0) {
        dp[i][j] += dp[i - 1][j - A[i - 1]];
        dp[i][j] %= 998244353;
      }
    }
  }
  for (long long i = (2); i <= (N); ++i) {
    for (long long j = (1); j < (i); ++j) {
      ans += dp[i][S] - dp[j][S];
      ans %= 998244353;
    }
  }
  cout << ans << endl;
  return 0;
}
