#include <bits/stdc++.h>
using namespace std;
const int N = 3007, M = 20, p = 998244353;
int n, k, a, b, w[N], cnt[N], fac[N], ans[N], ifac[N], f[N][M], c[N][N];
inline int read() {
  int num = 0;
  char g = getchar();
  while (g < 48 || 57 < g) g = getchar();
  while (47 < g && g < 58)
    num = (num << 1) + (num << 3) + g - 48, g = getchar();
  return num;
}
inline int mul(int a, int b) { return 1ll * a * b % p; }
inline int inc(int a, int b) {
  if (a + b >= p) return a + b - p;
  return a + b;
}
inline int pows(int u, int v) {
  int ans = 1;
  while (v > 0) {
    if (v & 1) ans = mul(ans, u);
    u = mul(u, u), v = v >> 1;
  }
  return ans;
}
inline void getdiv(int u) {
  if (u == 0)
    b--;
  else
    a = mul(a, pows(u, p - 2));
}
inline void getmul(int u) {
  if (u == 0)
    b++;
  else
    a = mul(a, u);
}
inline int getnum() {
  if (b == 0) return a;
  return 0;
}
int main() {
  n = read(), k = read(), fac[0] = ifac[0] = 1;
  for (int i = 1; i <= n; i++)
    w[i] = read(), fac[i] = mul(fac[i - 1], i), ifac[i] = pows(fac[i], p - 2);
  if (k == 1) {
    cout << 0 << ' ';
    for (int i = 1; i <= n; i++)
      printf("%d ", mul(mul(fac[n], ifac[i]), ifac[n - i]));
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    memset(cnt, 0, sizeof(cnt));
    a = 1, b = k;
    for (int x = i; x <= n; x++)
      getdiv(pows(2, cnt[w[x]]) - 1), c[i][x] = getnum(), cnt[w[x]]++,
                                      getmul(pows(2, cnt[w[x]]) - 1);
  }
  f[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = i; j <= n; j++)
      for (int x = 0; x <= 12; x++)
        f[j][x + 1] = inc(f[j][x + 1], mul(c[i][j], f[i - 1][x]));
  memset(cnt, 0, sizeof(cnt));
  for (int i = n; i >= 0; i--) {
    int opt = pows(2, n - i), sum = 1;
    for (int x = 1; x <= k; x++) sum = mul(sum, pows(2, cnt[x]) - 1);
    opt = (opt - sum + p) % p;
    for (int x = 0; x <= 12; x++) ans[x] = inc(mul(f[i][x], opt), ans[x]);
    cnt[w[i]]++;
  }
  ans[0] = (ans[0] - 1 + p) % p;
  for (int i = 0; i <= n; i++) printf("%d ", ans[i]);
  return 0;
}
