#include <bits/stdc++.h>
using namespace std;
const int MAXN = 3e3 + 5;
const int mod = 998244353;
const unsigned long long Lmod = (unsigned long long)mod * mod;
inline void add_mod(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline void add_Lmod(unsigned long long &a, unsigned long long b) {
  a += b;
  if (a >= mod) a -= mod;
}
inline long long pw(long long a, long long b) {
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long pw2[MAXN], coef[MAXN], icoef[MAXN];
int n, c;
int a[MAXN];
namespace Subtask1 {
int g[MAXN][MAXN], ans[MAXN];
void solve(void) {
  g[n + 1][0] = 1;
  ans[0] = coef[n];
  static int mxp[MAXN];
  for (int i = n; i >= 1; --i) {
    static unsigned long long f[MAXN];
    static int t[MAXN];
    memset(f, 0, sizeof(f));
    memset(t, 0, sizeof(t));
    int rem = c - 1, cur = 1;
    mxp[i] = (n - i + 1) / c;
    for (int j = i + 1; j <= n + 1; ++j) {
      if (!rem)
        for (int k = 0; k <= mxp[j]; ++k)
          add_Lmod(f[k], (unsigned long long)cur * g[j][k]);
      if (a[j] != a[i]) {
        cur = (long long)cur * icoef[t[a[j]]] % mod * coef[t[a[j]] + 1] % mod;
        if (!t[a[j]]++) --rem;
      }
    }
    for (int j = 1; j <= mxp[i]; ++j)
      g[i][j] = f[j - 1] % mod,
      ans[j] = (ans[j] + (long long)g[i][j] * pw2[i - 1]) % mod;
  }
  for (int i = 0; i <= n; ++i)
    add_mod(ans[i], mod - ans[i + 1]), printf("%d ", ans[i]);
  exit(0);
}
}  // namespace Subtask1
namespace Subtask2 {
const int ALL = (1 << 11) + 5;
long long g[MAXN][ALL];
void solve(void) {
  int all = (1 << c) - 1;
  g[0][0] = 1;
  for (int k = n; k >= 1; --k) {
    int mxp = (n - k + 1) / c;
    int cura = (1 << (a[k] - 1));
    for (int i = mxp; i >= 0; --i)
      for (int mask = all - 1; mask >= 0; --mask)
        if (g[i][mask]) {
          if ((mask | cura) == all)
            g[i + 1][0] += g[i][mask];
          else
            g[i][mask | cura] += g[i][mask];
        }
    if (k % 20 == 0) {
      for (int i = 0; i <= mxp; ++i)
        for (int mask = 0; mask <= all; ++mask) g[i][mask] %= mod;
    }
  }
  g[0][0] += mod - 1;
  int mxp = n / c;
  for (int i = 0; i <= n; ++i) {
    if (i > mxp) {
      printf("0 ");
      continue;
    }
    int res = 0;
    for (int mask = 0; mask < all; ++mask) add_mod(res, g[i][mask] % mod);
    printf("%d ", res);
  }
  exit(0);
}
}  // namespace Subtask2
int main(void) {
  pw2[0] = 1;
  coef[0] = 0;
  for (int i = 1; i < MAXN; ++i) pw2[i] = pw2[i - 1] * 2 % mod;
  for (int i = 0; i < MAXN; ++i)
    coef[i] = (pw2[i] - 1 + mod) % mod, icoef[i] = pw(coef[i], mod - 2);
  icoef[0] = 1;
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  Subtask1::solve();
  if (c > 11 || n <= (1 << c))
    Subtask1::solve();
  else
    Subtask2::solve();
  return 0;
}
