#include <bits/stdc++.h>
const int P = 998244353;
using namespace std;
inline void ckmax(int &a, int b) { a = max(a, b); }
inline void ckmin(int &a, int b) { a = min(a, b); }
inline void mulmod(int &a, int b) { a = 1ll * a * b % P; }
inline void addmod(int &a, int b) {
  int t = a + b;
  a = (t >= P ? t - P : t);
}
inline int ksm(int a, int b) {
  int ans = 1;
  for (; b; b >>= 1) {
    if (b & 1) ans = 1ll * ans * a % P;
    a = 1ll * a * a % P;
  }
  return ans;
}
inline int inv(int a) { return ksm(a, P - 2); }
namespace FastIO {
const int SIZE = 1 << 16;
char buf[SIZE], obuf[SIZE], str[64];
int bi = SIZE, bn = SIZE, opt;
int read(char *s) {
  while (bn) {
    for (; bi < bn && buf[bi] <= ' '; bi++)
      ;
    if (bi < bn) break;
    bn = fread(buf, 1, SIZE, stdin), bi = 0;
  }
  int sn = 0;
  while (bn) {
    for (; bi < bn && buf[bi] > ' '; bi++) s[sn++] = buf[bi];
    if (bi < bn) break;
    bn = fread(buf, 1, SIZE, stdin), bi = 0;
  }
  s[sn] = 0;
  return sn;
}
bool read(int &x) {
  if (x) x = 0;
  int bf = 0, n = read(str);
  if (!n) return 0;
  int i = 0;
  if (str[i] == '-') bf = 1, i = 1;
  for (x = 0; i < n; i++) x = x * 10 + str[i] - '0';
  if (bf) x = -x;
  return 1;
}
void write(int x) {
  if (!x)
    obuf[opt++] = '0';
  else {
    if (x < 0) obuf[opt++] = '-', x = -x;
    int sn = 0;
    while (x) str[sn++] = x % 10 + '0', x /= 10;
    for (int i = sn - 1; i >= 0; i--) obuf[opt++] = str[i];
  }
  if (opt >= (SIZE >> 1)) {
    fwrite(obuf, 1, opt, stdout);
    opt = 0;
  }
}
void write(char x) {
  obuf[opt++] = x;
  if (opt >= (SIZE >> 1)) {
    fwrite(obuf, 1, opt, stdout);
    opt = 0;
  }
}
void Fflush() {
  if (opt) fwrite(obuf, 1, opt, stdout);
  opt = 0;
}
};  // namespace FastIO
inline int read() {
  int x;
  FastIO::read(x);
  return x;
}
const int MAXN = 3005;
int n, c, a[MAXN];
namespace small {
int f[2][MAXN][1 << 12], ans[MAXN], C[MAXN][MAXN];
int main() {
  if (c == 1) {
    C[0][0] = 1;
    for (int i = (1); i <= (n); i++) {
      for (int j = (0); j <= (i); j++)
        C[i][j] = (j ? C[i - 1][j - 1] + C[i - 1][j] : 1);
    }
    printf("0 ");
    for (int i = (1); i <= (n); i++) {
      printf("%d ", C[n][i]);
    }
    return 0;
  }
  f[0][0][0] = 1;
  for (int i = (1); i <= (n); i++) a[i]--;
  for (int now = (0); now <= (n - 1); now++) {
    int i = now & 1;
    for (int j = (0); j <= (n / c); j++) {
      for (int st = (0); st <= ((1 << c) - 1); st++) {
        if ((st | (1 << a[now + 1])) == ((1 << c) - 1))
          addmod(f[i ^ 1][j + 1][0], f[i][j][st]);
        else
          addmod(f[i ^ 1][j][st | (1 << a[now + 1])], f[i][j][st]);
        addmod(f[i ^ 1][j][st], f[i][j][st]);
      }
    }
    for (int j = (0); j <= (n / c); j++)
      for (int st = (0); st <= ((1 << c) - 1); st++) f[i][j][st] = 0;
  }
  ans[0] = -1;
  for (int i = (0); i <= (n); i++)
    for (int st = (0); st <= ((1 << c) - 1); st++)
      addmod(ans[i], f[n & 1][i][st]);
  for (int i = (0); i <= (n); i++) printf("%d ", ans[i]);
  return 0;
}
}  // namespace small
namespace large {
int f[MAXN][MAXN], g[MAXN][MAXN], h[MAXN], cnt[MAXN], p2[MAXN], im[MAXN],
    ans[MAXN];
int main() {
  p2[0] = 1;
  for (int i = (1); i <= (n); i++)
    p2[i] = p2[i - 1] * 2 % P, im[i] = inv(p2[i] - 1);
  a[n + 1] = c + 1;
  for (int i = (1); i <= (n + 1); i++) {
    memset(cnt, 0, sizeof(cnt));
    cnt[a[i]] = 1;
    int t = c - 1;
    g[i][i] = 1;
    for (int j = i - 1; j >= 1; j--) {
      int para = 1;
      if (a[j] != a[i]) {
        if (cnt[a[j]]) mulmod(para, im[cnt[a[j]]]);
        cnt[a[j]]++;
        mulmod(para, p2[cnt[a[j]]] - 1);
      }
      g[j][i] = 1ll * g[j + 1][i] * para % P;
    }
    memset(cnt, 0, sizeof(cnt));
    g[i][i] = 0;
    if (i == n + 1) t++;
    for (int j = i - 1; j >= 1; j--) {
      if (a[j] != a[i]) {
        if (!cnt[a[j]]) t--;
        cnt[a[j]]++;
      }
      if (t)
        g[j][i] = 0;
      else
        break;
    }
    if (i == n + 1) {
      for (int j = (1); j <= (i); j++) h[j] = (p2[i - j] - g[j][i] + P) % P;
    }
  }
  f[0][0] = 1;
  for (int i = (1); i <= (n); i++) {
    for (int j = (0); j <= (n / c); j++) {
      for (int k = (0); k <= (i - 1); k++) {
        addmod(f[i][j], 1ll * f[k][j - 1] * g[k + 1][i] % P);
      }
    }
  }
  for (int i = (0); i <= (n); i++)
    for (int j = (0); j <= (n / c); j++)
      addmod(ans[j], 1ll * f[i][j] * h[i + 1] % P);
  ans[0] = (ans[0] + P - 1) % P;
  for (int i = (0); i <= (n); i++) {
    printf("%d ", ans[i]);
  }
  return 0;
}
}  // namespace large
signed main() {
  n = read(), c = read();
  for (int i = (1); i <= (n); i++) a[i] = read();
  if (c <= 12)
    return small::main();
  else
    return large::main();
  return FastIO::Fflush(), 0;
}
