#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3c3c3c3c;
const long long LINF = 1ll * INF * INF * 2;
const int N = 3001;
const long long MOD = 998244353;
int n, m;
long long x[N];
long long ans[N][200];
long long P[N];
long long cnt[N + N];
int B = 1;
int main(void) {
  scanf("%d%d", &n, &m);
  while (B <= m) B = B + B;
  P[0] = 1;
  for (int i = 1; i <= n; i++) P[i] = (P[i - 1] + P[i - 1]) % MOD;
  for (int i = 0; i < n; i++) scanf("%d", x + i);
  for (int i = B; i < B + B; i++) cnt[i] = 1;
  for (int i = B + 1; i <= B + m; i++) cnt[i] = 0;
  for (int i = B - 1; i >= 1; i--)
    cnt[i] = (1ll * (cnt[i + i]) * (cnt[i + i + 1]) % MOD);
  ans[0][n] = 1;
  for (int i = n - 1; i >= 0; i--) {
    int cur = x[i] + B;
    cnt[cur] = cnt[cur] + cnt[cur] + 1;
    cur /= 2;
    while (cur)
      cnt[cur] = (1ll * (cnt[cur + cur]) * (cnt[cur + cur + 1]) % MOD),
      cur /= 2;
    ans[0][i] = P[n - 1 - i + 1] - cnt[1];
    if (ans[0][i] < 0) ans[0][i] += MOD;
  }
  for (int p = 1; 1ll * p * p <= n; p++) {
    for (int j = n - 1; j >= 0; j--) {
      for (int i = B; i < B + B; i++) cnt[i] = 1;
      for (int i = B + 1; i <= B + m; i++) cnt[i] = 0;
      cnt[B + x[j]] = 1;
      for (int i = B - 1; i >= 1; i--)
        cnt[i] = (1ll * (cnt[i + i]) * (cnt[i + i + 1]) % MOD);
      for (int i = j; i >= 0; i--) {
        if (x[i] != x[j]) {
          int cur = x[i] + B;
          cnt[cur] = cnt[cur] + cnt[cur] + 1;
          cur /= 2;
          while (cur)
            cnt[cur] = (1ll * (cnt[cur + cur]) * (cnt[cur + cur + 1]) % MOD),
            cur /= 2;
        }
        ans[p][i] += (1ll * (ans[p - 1][j + 1]) * (cnt[1]) % MOD);
      }
    }
    for (int i = 0; i < n; i++) ans[p][i] %= MOD;
  }
  ans[0][0]--;
  for (int i = 0; i <= n; i++) printf("%d ", ((ans[i][0] % MOD) + MOD) % MOD);
}
