#include <bits/stdc++.h>
using namespace std;
const long long MOD = 998244353;
long long qpow(long long x, long long a) {
  long long res = x, ret = 1;
  while (a > 0) {
    if ((a & 1) == 1) ret = ret * res % MOD;
    a >>= 1;
    res = res * res % MOD;
  }
  return ret;
}
long long n, c, a[3010], ans[3010], fst[3010], pw2[3010], inv[3010], repl[3010],
    mxp;
long long dp[3010][3010];
long long dp2[2][3010][600];
vector<long long> v;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> c;
  for (int i = 0; i < n; i++) cin >> a[i];
  mxp = n / c;
  for (int i = 1; i <= 3005; i++) {
    pw2[i] = pw2[i - 1] * 2LL % MOD;
    repl[i] = (pw2[i] - 1 + MOD) % MOD;
  }
  for (int i = 1; i <= 3005; i++)
    inv[i] = qpow((pw2[i] - 1 + MOD) % MOD, MOD - 2) % MOD;
  pw2[0] = 1;
  if (c > 9) {
    dp[0][0] = 1;
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < c + 5; j++) fst[j] = 0;
      long long mul = 1, cnt = 0;
      for (int j = i; j < n; ++j) {
        ++fst[a[j]];
        if (fst[a[j]] == 1)
          ++cnt;
        else
          mul = mul * inv[fst[a[j]] - 1] * repl[fst[a[j]]] % MOD;
        if (cnt == c) {
          long long mull = mul * inv[fst[a[j]] - 1] % MOD,
                    bd = min((long long)(i + 1), mxp + 1);
          for (int k = 0; k < bd; k++)
            dp[j + 1][k + 1] = (dp[j + 1][k + 1] + dp[i][k] * mull) % MOD;
        }
        if (j == n - 1) {
          for (int k = 1; k <= i + 1; k++) {
            long long mull = (pw2[n - i] - mul + MOD) % MOD;
            if (cnt != c) mull = pw2[n - i];
            ans[k] = (ans[k] + dp[i][k] * mull) % MOD;
          }
        }
      }
    }
    for (int j = 1; j <= mxp; j++) ans[j] = (ans[j] + dp[n][j]) % MOD;
    ans[0] = (pw2[n] - 1 + MOD) % MOD;
    for (int i = 1; i <= mxp; i++) ans[0] = (ans[0] - ans[i] + MOD) % MOD;
  } else {
    dp2[0][0][0] = 1;
    for (int ii = 0; ii < n; ii++) {
      int i = (ii & 1);
      for (int j = 0; j < mxp + 5; j++)
        for (int k = 0; k < (1 << c) + 5; k++) dp2[i ^ 1][j][k] = 0;
      for (int j = 0; j < min((long long)(ii + 1), mxp + 1); j++)
        for (int k = 0; k < 1 << c; k++) {
          if (dp2[i][j][k] == 0) continue;
          dp2[i ^ 1][j][k] = (dp2[i ^ 1][j][k] + dp2[i][j][k]) % MOD;
          if ((k | (1 << (a[ii] - 1))) == (1 << c) - 1)
            dp2[i ^ 1][j + 1][0] = (dp2[i ^ 1][j + 1][0] + dp2[i][j][k]) % MOD;
          else
            dp2[i ^ 1][j][k | (1 << (a[ii] - 1))] =
                (dp2[i ^ 1][j][k | (1 << (a[ii] - 1))] + dp2[i][j][k]) % MOD;
        }
    }
    int i = (n & 1);
    for (int j = 0; j < mxp + 1; j++)
      for (int k = 0; k < (1 << c) - 1; k++)
        ans[j] = (ans[j] + dp2[i][j][k]) % MOD;
    ans[0] = (ans[0] - 1 + MOD) % MOD;
  }
  for (int i = 0; i < n + 1; i++) cout << ans[i] << ' ';
  cout << endl;
  return 0;
}
