#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int mxn = 3001, cutoff = 10, mod = 998244353;
const bool DEBUG = 0;
ll half;
int n, c, k;
int a[mxn];
ll powe[mxn], invi[mxn];
ll ans[mxn], dp[mxn][mxn];
ll modpow(ll a, ll b) {
  a %= mod;
  return b ? (modpow(a * a % mod, b / 2) * (b & 1 ? a : 1LL)) % mod : 1LL;
}
ll inv(ll a) { return modpow(a, mod - 2); }
void quickadd(ll &a, ll b) {
  a += b;
  if (a >= mod) a -= mod;
}
void method2() {
  k = n / c;
  for (int i = 0; i < mxn; i++)
    for (int j = 0; j < mxn; j++) dp[i][j] = 0;
  int maxmask = (1 << c) - 1;
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    int shade = 1 << a[i];
    for (int p = k; p >= 0; p--)
      for (int mask = maxmask - 1; mask >= 0; mask--)
        if (dp[p][mask]) {
          int nmask = ((mask | shade) == maxmask ? 0 : mask | shade);
          quickadd(dp[p + !nmask][nmask], dp[p][mask]);
        }
  }
  for (int p = 0; p <= n; p++) {
    ans[p] = p ? 0 : -1;
    if (p <= k)
      for (int mask = 0; mask < maxmask; mask++) quickadd(ans[p], dp[p][mask]);
    cout << ans[p] << " ";
  }
  cout << endl;
}
void method1() {
  k = n / c;
  for (int i = 0; i <= n; i++)
    powe[i] = i ? (2 * powe[i - 1]) % mod : 1,
    invi[i] = inv((powe[i] - 1 + mod) % mod);
  for (int i = 0; i < mxn; i++)
    for (int j = 0; j < mxn; j++) dp[i][j] = 0;
  dp[0][n] = 1;
  for (int j = n - 1; j >= 0; j--) {
    int cnt = c;
    ll X = 0;
    vector<int> freq(c, 0);
    for (int i = j; i >= 0; i--) {
      if (!freq[a[i]]++) {
        if (!--cnt) {
          X = 1;
          for (int cc = 0; cc < c; cc++)
            X = X * (powe[freq[cc]] - 1 + mod) % mod;
        }
      } else
        X = X * (powe[freq[a[i]]] - 1 + mod) % mod * invi[freq[a[i]] - 1] % mod;
      ll ways = X ? X * invi[freq[a[i]]] : 0;
      if (ways)
        for (int p = 1; p <= k; p++)
          quickadd(dp[p][i], ways * dp[p - 1][j + 1] % mod);
    }
  }
  for (int p = 0; p < mxn; p++) ans[p] = 0;
  ll X = 0;
  for (int p = k; p > 0; p--) {
    ans[p] = (mod - X) % mod;
    for (int i = 0; i < n; i++) quickadd(ans[p], dp[p][i] * powe[i] % mod);
    quickadd(X, ans[p]);
  }
  ans[0] = (powe[n] - 1 - X + 2 * mod) % mod;
  for (int p = 0; p <= n; p++) cout << ans[p] << " ";
  cout << endl;
}
int main() {
  if (DEBUG) freopen("input.txt", "r", stdin);
  if (DEBUG) freopen("output.txt", "w", stdout);
  cin >> n >> c;
  k = n / c;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i]--;
  }
  half = inv(2);
  if (c > cutoff)
    method1();
  else
    method2();
  return 0;
}
