#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const long long INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
const int DX[] = {1, 0, -1, 0}, DY[] = {0, -1, 0, 1};
const long long MOD = 998244353;
void solve(long long N, long long S, std::vector<long long> A) {
  long long ans = 0;
  for (int i = 0; i < (N); i++) {
    vector<int> dp(3001, 0);
    dp[0] = 1;
    for (int j = (i); j < (N); j++) {
      for (int k = (S - 1); k >= 0; k--) {
        if (k + A[j] <= S) {
          dp[k + A[j]] += dp[k];
          dp[k + A[j]] %= MOD;
        }
      }
      ans += dp[S];
      ans %= MOD;
    }
  }
  cout << ans << endl;
}
int main() {
  long long N;
  scanf("%lld", &N);
  long long S;
  scanf("%lld", &S);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, S, std::move(A));
  return 0;
}
