#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx")
using namespace std;
int a, b, c, d, n, m, k;
int ans[3002], mas[3002];
int cnt[3002];
int p2[3002], p2m1[3002], ip2m1[3002];
int f[3002][3002], g[3002][3002], gg[3002][3002], ff[3002][3002];
const long long modll = (long long)998244353 << 32;
inline int fpow(int a, int st) {
  int ans = 1;
  while (st) {
    if (st % 2) ans = (long long)ans * a % 998244353;
    a = (long long)a * a % 998244353;
    st /= 2;
  }
  return ans;
}
int main() {
  scanf("%d%d", &n, &c);
  for (int _n((n)-1), i(0); i <= _n; i++) {
    scanf("%d", &mas[i]);
    --mas[i];
  }
  p2[0] = 1;
  p2m1[0] = 0;
  for (int _n((3000)), i(1); i <= _n; i++) {
    p2[i] = p2[i - 1] * 2 % 998244353;
    p2m1[i] = p2[i] - 1;
    if (p2m1[i] < 0) p2m1[i] += 998244353;
    ip2m1[i] = fpow(p2m1[i], 998244353 - 2);
  }
  if (c == 1) {
    for (int _n((n + 1) - 1), i(0); i <= _n; i++) {
      f[i][0] = f[i][i] = 1;
      for (int _n((i - 1)), j(1); j <= _n; j++) {
        f[i][j] = f[i - 1][j] + f[i - 1][j - 1];
        if (f[i][j] >= 998244353) f[i][j] -= 998244353;
      }
    }
    for (int _n((n + 1) - 1), i(0); i <= _n; i++) {
      ans[i] = f[n][i];
    }
    ans[0] = 0;
    for (int _n((n + 1) - 1), i(0); i <= _n; i++) {
      if (i) printf(" ");
      printf("%d", ans[i]);
    }
    printf("\n");
    exit(0);
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    memset((cnt), 0, sizeof(cnt));
    int cz = c;
    int p = 1;
    for (int _n(n - 1), j(i); j <= _n; j++) {
      if (!cnt[mas[j]]) {
        --cz;
        ++cnt[mas[j]];
      } else {
        p = (long long)p * ip2m1[cnt[mas[j]]] % 998244353;
        ++cnt[mas[j]];
        p = (long long)p * p2m1[cnt[mas[j]]] % 998244353;
      }
      if (cz) {
        f[i][j] = 0;
      } else {
        f[i][j] = p;
      }
    }
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    g[1][i] = f[0][i];
    gg[1][i] = f[0][i];
    if (i) {
      gg[1][i] -= gg[1][i - 1];
      if (gg[1][i] < 0) gg[1][i] += 998244353;
    }
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    for (int _n(n - 1), j(i); j <= _n; j++) {
      ff[j][i] = f[i][j];
      if (i != j) {
        ff[j][i] -= f[i + 1][j];
        if (ff[j][i] < 0) ff[j][i] += 998244353;
      }
    }
  }
  for (int _n(n), k(2); k <= _n; k++) {
    for (int _n((n)-1), r(0); r <= _n; r++) {
      if (r + 1 < k * c) {
        g[k][r] = 0;
        gg[k][r] = 0;
        continue;
      }
      long long t = 0;
      for (int z = (r - 1), _b = (0); z >= _b; z--) {
        if (z + 1 < (k - 1) * c) break;
        t += (long long)gg[k - 1][z] * ff[r][z + 1];
        if (t >= modll) t -= modll;
      }
      g[k][r] = t % 998244353;
      gg[k][r] = g[k][r];
      if (r) {
        gg[k][r] -= gg[k][r - 1];
        if (gg[k][r] < 0) gg[k][r] += 998244353;
      }
    }
  }
  ans[0] = p2m1[n];
  for (int _n((n)), i(1); i <= _n; i++) {
    ans[i] = g[i][n - 1];
  }
  for (int _n((n)-1), i(0); i <= _n; i++) {
    ans[i] -= ans[i + 1];
    if (ans[i] < 0) ans[i] += 998244353;
  }
  for (int _n((n + 1) - 1), i(0); i <= _n; i++) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
}
