#include <bits/stdc++.h>
using namespace std;
const int mod = 998244353;
int pow2[3005];
int n, k, c, lim;
int a[3005];
int f[3005][3005], g[3005][3005];
int s[3005];
namespace usual {
int add(int ta, int tb) { return ta + tb >= mod ? ta + tb - mod : ta + tb; }
int sub(int ta, int tb) { return ta < tb ? ta - tb + mod : ta - tb; }
int ksm(long long ta, int tp) {
  int s = 1;
  for (; tp; ta = ta * ta % mod, tp >>= 1)
    if (tp & 1) s = ta * s % mod;
  return s;
}
}  // namespace usual
using namespace usual;
void make_pow2() {
  pow2[0] = 1;
  for (int i = 1; i <= n; i++) pow2[i] = (pow2[i - 1] << 1) % mod;
}
int id(int i) { return 1 << (i - 1); }
void work1() {
  int limc = 1 << c;
  g[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    int ia = id(a[i]);
    for (int j = k; j >= 0; j--) {
      if (j > 0) f[i][j] = g[j - 1][limc - 1 - ia];
      for (int t = ia; t < limc; t = (t + 1) | ia)
        g[j][t] = add((g[j][t] << 1) % mod, g[j][t - ia]);
      g[j][0] = add(g[j][0], f[i][j]);
    }
  }
}
int cnt[3005];
void work2() {
  int ts, flag;
  for (int i = 1, j; i <= n; i++) {
    memset(cnt + 1, 0, n * 4);
    ts = 1;
    flag = 0;
    for (j = i; j <= n; j++) {
      if (!cnt[a[j]]) flag++;
      cnt[a[j]]++;
      if (flag == c) break;
    }
    for (int t = 1; t <= c; t++) ts = 1ll * ts * (pow2[cnt[t]] - 1) % mod;
    g[i][j] = ts;
    for (j++; j <= n; j++) {
      ts = 1ll * ts * ksm(pow2[cnt[a[j]]] - 1, mod - 2);
      g[i][j] = ts;
      cnt[a[j]]++;
      ts = 1ll * ts * (pow2[cnt[a[j]]] - 1) % mod;
    }
  }
  f[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= k; j++)
      for (int t = c * (j - 1); t < i; t++)
        f[i][j] = add(f[i][j], 1ll * f[t][j - 1] * g[t + 1][i] % mod);
}
int main() {
  scanf("%d %d", &n, &c);
  k = n / c;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  make_pow2();
  lim = 0;
  while ((1 << lim) <= n) lim++;
  lim--;
  if (c <= lim)
    work1();
  else
    work2();
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= k; j++)
      s[j] = add(s[j], 1ll * f[i][j] * pow2[n - i] % mod);
  s[0] = pow2[n] - 1;
  for (int i = 0; i <= n; i++) printf("%d ", sub(s[i], s[i + 1]));
  printf("\n");
  return 0;
}
