#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
using edge = struct {
  int to;
  long long cost;
};
template <class t, class u>
void chmax(t& a, u b) {
  if (a < b) a = b;
}
template <class t, class u>
void chmin(t& a, u b) {
  if (b < a) a = b;
}
using Graph = vector<vector<int>>;
const long long d = 998244353;
int dp[3000][3001];
int main() {
  int N;
  cin >> N;
  int S;
  cin >> S;
  vector<int> A(N);
  vector<int> ans(N, 0);
  for (int i = 0; i < N; ++i) {
    cin >> A[i];
  }
  for (int i = 0; i < 3000; ++i) {
    for (int j = 0; j < 3001; ++j) {
      dp[i][j] = 0;
    }
  }
  dp[0][0] = 1;
  dp[0][A[0]] = 1;
  for (int i = 0; i < N - 1; i++) {
    for (int s = 0; s < S + 1; s++) {
      if (s + A[i + 1] > S) {
        dp[i + 1][s] += dp[i][s];
        dp[i + 1][s] = dp[i + 1][s] % d;
        continue;
      }
      dp[i + 1][s + A[i + 1]] += dp[i][s];
      dp[i + 1][s + A[i + 1]] = dp[i + 1][s + A[i + 1]] % d;
      dp[i + 1][s] += dp[i][s];
      dp[i + 1][s] = dp[i + 1][s] % d;
    }
  }
  for (int i = N - 1; i > 0; i--) {
    dp[i][S] -= dp[i - 1][S];
  }
  long long ans1 = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i; j < N; j++) {
      ans1 = ans1 + dp[j][S];
      ans1 = ans1 % d;
      cout << ans1 << endl;
    }
  }
  cout << ans1 << endl;
  return 0;
}
