#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
const int M = 998244353;
void add(ll &x, ll y) { x = (x + y) % M; }
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0), cout.tie(0);
  int n, s;
  cin >> n >> s;
  vector<ll> a(n);
  for (ll &x : a) cin >> x;
  vector<ll> q(s + 1);
  ll ans = 0;
  for (int i = 0; i < (int)(n); ++i) {
    add(q[0], 1);
    for (int j = s; j >= 0; --j) {
      if (j + a[i] <= s) add(q[j + a[i]], q[j]);
    }
    add(ans, q[s]);
  }
  for (int i = 0; i < s + 1; ++i) {
    cout << q[i] << endl;
  }
  cout << ans << endl;
}
