#include <bits/stdc++.h>
using namespace std;
void fr(long long &a, bool f = 0, char ch = getchar()) {
  for (a = 0; ch < '0' || ch > '9'; ch = getchar()) ch == '-' ? f = 1 : 0;
  for (; ch >= '0' && ch <= '9'; ch = getchar()) a = a * 10 + ch - '0';
  a = f ? -a : a;
}
long long fr() {
  long long a;
  return fr(a), a;
}
const long long N = 3e3, S = 1 << 10, P = 998244353;
signed cnt[N + 10], f[N + 10][N + 10];
long long n, c, p2[N + 10], p2m[N + 10], invp2[N + 10], invp2m[N + 10],
    sum[N + 10][N + 10], f1[5][N + 10][S + 10], g[N + 10], a[N + 10];
long long qpow(long long a, long long b) {
  long long ret = 1;
  for (; b; b >>= 1, a = a * a % P) b & 1 ? ret = ret * a % P : 0;
  return ret;
}
void work() {
  f1[0][0][0] = 1;
  for (signed i = 1; i <= n; i++) {
    for (signed j = 0; j <= i && j <= n / c; j++)
      for (signed k = 0; k + 1 < (1 << c); k++) f1[i & 1][j][k] = 0;
    for (signed j = 0; j <= i && j <= n / c; j++)
      for (signed k = 0; k + 1 < (1 << c); k++) {
        if (f1[(i & 1) ^ 1][j][k] == 0) continue;
        f1[i & 1][j][k] = (f1[i & 1][j][k] + f1[(i & 1) ^ 1][j][k]) % P;
        if ((k | (1 << (a[i] - 1))) == (1 << c) - 1)
          f1[i & 1][j + 1][0] =
              (f1[i & 1][j + 1][0] + f1[(i & 1) ^ 1][j][k]) % P;
        else
          f1[i & 1][j][k | (1 << (a[i] - 1))] =
              (f1[i & 1][j][k | (1 << (a[i] - 1))] + f1[(i & 1) ^ 1][j][k]) % P;
      }
  }
  g[0] = P - 1;
  for (signed i = 0; i <= n; i++) {
    for (signed j = 0; j < (1 << c); j++) g[i] = (g[i] + f1[n & 1][i][j]) % P;
    printf("%lld ", g[i]);
  }
  puts("");
}
struct OI {
  long long RP, score;
} FJOI2021;
signed main() {
  FJOI2021.RP++, FJOI2021.score++, 392699;
  fr(n), fr(c);
  for (signed i = 1; i <= n; i++) fr(a[i]);
  if (c == 1) {
    f[0][0] = 1;
    for (signed i = 1; i <= n; i++) {
      f[i][0] = 1;
      for (long long j = 1; j <= i; j++)
        f[i][j] = 1ll * (f[i - 1][j] + f[i - 1][j - 1]) % P;
    }
    printf("0 ");
    for (signed i = 1; i <= n; i++) printf("%lld ", f[n][i]);
    return puts(""), 0;
  }
  if (c <= 10) return work(), 0;
  f[n + 1][0] = sum[n + 1][0] = p2[0] = invp2[0] = invp2m[0] = 1;
  for (signed i = 1; i <= n; i++)
    p2[i] = p2[i - 1] * 2 % P, p2m[i] = p2[i] - 1,
    invp2[i] = qpow(p2[i], P - 2), invp2m[i] = qpow(invp2m[i], P - 2);
  for (long long i = 1, tot, tmp; i <= n; i++) {
    memset(cnt, 0, sizeof(cnt)), tot = tmp = cnt[a[i]] = 1;
    for (signed j = i + 1; j <= n; j++) {
      if (a[i] == a[j])
        tmp = tmp * 2 % P;
      else {
        tmp = tmp * invp2m[cnt[a[j]]] % P, cnt[a[j]]++,
        tmp = tmp * p2m[cnt[a[j]]] % P;
        if (cnt[a[j]] == 1) tot++;
      }
      if (tot == c && a[i] != a[j]) f[i][j] = tmp * invp2m[cnt[a[j]]] % P;
    }
  }
  for (signed i = n; i; i--) {
    for (signed j = 1; j <= n - i + 1; j++) {
      long long tot = 0;
      for (signed k = i + c - 1; k <= n && sum[k + 1][j - 1]; k++)
        tot = (tot + f[i][k] * sum[k + 1][j - 1] % P) % P;
      if (tot == 0) break;
      f[i][j] = tot;
    }
    f[i][0] = p2[n - i];
    for (signed j = 0; j <= n - i + 1; j++)
      sum[i][j] = (sum[i + 1][j] + f[i][j]) % P;
  }
  sum[1][0]--;
  for (signed i = 0; i <= n; i++)
    printf("%lld ", (sum[1][i] - sum[1][i + 1] + P) % P);
  return puts(""), 0;
}
