#include <bits/stdc++.h>
using namespace std;
const int N = 3010, C = 3010, MOD = 998244353;
int minv(int a, int m = MOD) {
  return a == 1 ? 1 : m - 1LL * minv(m % a, a) * m / a;
}
int pow2[N], pow2m1[N], pow2inv[N], pow2m1inv[N];
void precomp() {
  pow2[0] = pow2inv[0] = 1;
  for (int i = 1; i < N; i++) {
    pow2[i] = pow2[i - 1] * 2 % MOD;
    pow2m1[i] = (MOD - 1 + pow2[i]) % MOD;
    pow2inv[i] = 1LL * pow2inv[i - 1] * ((MOD + 1) / 2) % MOD;
    pow2m1inv[i] = minv(pow2m1[i]);
  }
}
int n, c, a[N], dp[N][N], u[2][N][1 << 8], num[N][N], ans[N], cnt[C];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  precomp();
  cin >> n >> c;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    --a[i];
  }
  dp[0][0] = 1;
  if (c < 9) {
    dp[0][0] = u[0][0][0] = 1;
    int all = (1 << c) - 1;
    for (int i = 0; i < n; i++) {
      int i_ = i & 1, j_ = i_ ^ 1;
      memset(u[j_], 0, sizeof u[0]);
      for (int t = 0; c * (t + 1) <= n; t++) {
        for (int m = 0; m < (1 << c); m++) {
          if (u[i_][t][m] != 0) {
            u[j_][t][m] += u[i_][t][m];
            u[j_][t][m] %= MOD;
            int t1 = t, m1 = m | (1 << a[i]);
            if (m1 == all) {
              t1 = t + 1;
              m1 = 0;
            }
            u[j_][t1][m1] += u[i_][t][m];
            u[j_][t1][m1] %= MOD;
          }
        }
        dp[i + 1][t + 1] = u[i_][t][all & ~(1 << a[i])];
      }
    }
  } else {
    for (int i = 0; i < n; i++) {
      fill(cnt, cnt + c, 0);
      int bad = c;
      int prod = 1;
      int j = i + 1;
      for (; j <= n && bad > 0; j++) {
        if (cnt[a[j - 1]] == 0) {
          bad--;
        }
        cnt[a[j - 1]]++;
        if (bad == 0) {
          num[i][j] = 1;
        }
      }
      for (; j <= n; j++) {
        num[i][j] = 1LL * prod * pow2m1inv[cnt[a[j - 1]]] % MOD;
        cnt[a[j - 1]]++;
        prod = 1LL * num[i][j] * pow2m1[cnt[a[j - 1]]] % MOD;
      }
    }
    for (int j = 1; j <= n; j++) {
      for (int t = 1; c * t <= n; t++) {
        for (int i = 0; i < j; i++) {
          dp[j][t] += 1LL * dp[i][t - 1] * num[i][j] % MOD;
          dp[j][t] %= MOD;
        }
      }
    }
  }
  for (int i = 0; i <= n; i++) {
    for (int t = 0; t <= n; t++) {
      ans[t] += 1LL * dp[i][t] * pow2[n - i] % MOD;
      ans[t] %= MOD;
    }
  }
  for (int t = 0; t <= n; t++) {
    ans[t] += MOD - ans[t + 1];
    ans[t] %= MOD;
  }
  ans[0]--;
  if (ans[0] < 0) ans[0] += MOD;
  for (int t = 0; t <= n; t++) {
    cout << ans[t] << " \n"[t == n];
  }
}
