#include <bits/stdc++.h>
using namespace std;
int main() {
  int N, S;
  cin >> N >> S;
  vector<int> A(N);
  for (int i = 0; i < (N); ++i) cin >> A[i];
  vector<vector<long long> > dp(N, vector<long long>(S + 1, 0));
  dp[0][A[0]] = 1;
  for (int i = 0; i < (N); ++i) dp[i][0] = 1;
  for (int i = 1; i < N; i++) {
    for (int j = 0; j <= S; j++) {
      dp[i][j] = dp[i - 1][j];
    }
    for (int j = 0; j <= S; j++) {
      if (j + A[i] <= S) {
        dp[i][j + A[i]] = (dp[i][j + A[i]] + dp[i - 1][j]) % 998244353;
      }
    }
  }
  for (int i = 0; i < (N); ++i) {
    for (int j = 0; j < (S + 1); ++j) cout << dp[i][j];
    cout << endl;
  }
  long long sum = 0;
  for (int L = 0; L < N; L++) {
    for (int R = L; R < N; R++) {
      if (L != R) {
        sum = (sum + dp[R][S]) % 998244353;
        sum = (sum + 998244353 - (L > 0 ? dp[L - 1][S] : 0)) % 998244353;
        cout << dp[R][S] - (L > 0 ? dp[L - 1][S] : 0) << endl;
      } else if (A[L] == S)
        sum = (sum + 1) % 998244353;
    }
  }
  cout << sum << endl;
  return 0;
}
