#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
int n, m, c;
int a[3005];
long long pw2[3005], invpw[3005];
inline long long getInv(long long x) {
  int exp = MOD - 2;
  long long ret = 1, tmp = x;
  while (exp) {
    if (exp & 1) ret = ret * tmp % MOD;
    tmp = tmp * tmp % MOD;
    exp >>= 1;
  }
  return ret;
}
inline void ADD(int &x, int y) {
  x += y;
  if (x >= MOD) x -= MOD;
}
int dp1[3005][305];
int cnt[3005][3005];
int ans[3005];
long long coef[3005];
inline void solve1() {
  for (int i = 1; i <= (n); ++i) {
    for (int j = 1; j <= (c); ++j) cnt[j][i] = cnt[j][i - 1];
    cnt[a[i]][i]++;
  }
  dp1[0][0] = 1;
  for (int j = 1; j <= (m); ++j)
    for (int i = j * c; i <= n; ++i) {
      int cur = 1;
      int cnt0 = c - 1;
      for (int ii = i - 1; ii >= 1; --ii) {
        if (a[ii] != a[i]) {
          int del = cnt[a[ii]][i] - cnt[a[ii]][ii - 1];
          if (del == 1)
            --cnt0;
          else
            cur = (long long)cur * coef[del] % MOD;
        }
        if (!cnt0 && dp1[ii - 1][j - 1])
          ADD(dp1[i][j], (long long)dp1[ii - 1][j - 1] * cur % MOD);
      }
    }
  for (int i = 1; i <= (n); ++i) {
    long long sub = 1;
    for (int k = 1; k <= (c); ++k)
      sub = sub * (pw2[cnt[k][n] - cnt[k][i]] - 1) % MOD;
    int fact = pw2[n - i] - sub;
    if (fact < 0) fact += MOD;
    for (int j = 1; j <= (m); ++j)
      if (dp1[i][j]) ADD(ans[j], (long long)dp1[i][j] * fact % MOD);
  }
  ans[0] = pw2[n] - 1;
  for (int j = 1; j <= (m); ++j) ADD(ans[0], MOD - ans[j]);
  ans[0] %= MOD;
  if (ans[0] < 0) ans[0] += MOD;
}
int dp2[2][3005][1 << 11];
inline void solve2() {
  int cur = 0, nxt = 1;
  dp2[0][0][0] = 1;
  int fullmask = (1 << c) - 1;
  for (int i = 1; i <= (n); ++i) {
    for (int j = 0; j <= (i - 1) / c; ++j)
      for (int mask = 0; mask < (1 << c); ++mask)
        if (dp2[cur][j][mask]) {
          ADD(dp2[nxt][j][mask], dp2[cur][j][mask]);
          if ((mask | (1 << a[i] - 1)) == fullmask)
            ADD(dp2[nxt][j + 1][0], dp2[cur][j][mask]);
          else
            ADD(dp2[nxt][j][mask | (1 << a[i] - 1)], dp2[cur][j][mask]);
          dp2[cur][j][mask] = 0;
        }
    swap(cur, nxt);
    if (i == n) {
      for (int j = 0; j < (m + 1); ++j)
        for (int mask = 0; mask < (1 << c); ++mask)
          ADD(ans[j], dp2[cur][j][mask]);
    }
  }
  --ans[0];
}
int main() {
  ios::sync_with_stdio(false);
  cin >> n >> c;
  pw2[0] = 1;
  for (int i = 1; i <= (n); ++i) {
    pw2[i] = pw2[i - 1] << 1;
    if (pw2[i] >= MOD) pw2[i] -= MOD;
  }
  for (int i = 2; i <= n; ++i)
    coef[i] = (pw2[i] - 1) * getInv(pw2[i - 1] - 1) % MOD;
  for (int i = 1; i <= (n); ++i) invpw[i] = getInv(pw2[i] - 1);
  for (int i = 1; i <= (n); ++i) cin >> a[i];
  m = n / c;
  if (c > 11)
    solve1();
  else
    solve2();
  for (int j = 0; j < (n + 1); ++j) printf("%lld ", ans[j]);
  return 0;
}
