#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MD = 998244353;
const int N = 3003;
int n, c;
int a[N];
inline ll pwer(ll a, ll b, ll ret = 1ll) {
  for (; b; b >>= 1, a = a * a % MD)
    if (ret & 1) ret = ret * a % MD;
  return ret;
}
namespace FA1 {
ll dp[N][N], dk[N], dk1[N], invdk[N], invdk1[N];
ll sum[N][N];
int f[N][N];
int cnt[N];
void fa1() {
  dp[n + 1][0] = 1;
  dk[0] = 1;
  invdk[0] = 1;
  invdk1[0] = 1;
  for (int i = 1; i <= n; i++) {
    dk[i] = dk[i - 1] * 2ll % MD;
    dk1[i] = (dk[i] - 1 + MD) % MD;
    invdk[i] = pwer(dk[i], MD - 2);
    invdk1[i] = pwer(dk1[i], MD - 2);
  }
  for (int l = 1; l < n; l++) {
    memset(cnt, 0, sizeof cnt);
    int tot = 1;
    ll ji = 1;
    cnt[a[l]] = 1;
    for (int r = l + 1; r <= n; r++) {
      if (a[l] == a[r]) {
        ji = ji * 2ll % MD;
      } else {
        ji = ji * invdk1[cnt[a[r]]] % MD;
        cnt[a[r]]++;
        ji = ji * dk1[cnt[a[r]]] % MD;
        if (cnt[a[r]] == 1) tot++;
      }
      if (tot == c && a[r] != a[l]) {
        f[l][r] = ji * invdk1[cnt[a[r]]] % MD;
      }
    }
  }
  sum[n + 1][0] = 1;
  for (int i = n; i >= 1; i--) {
    for (int j = 1; j <= n - i + 1; j++) {
      ll tot = 0;
      for (int k = i + c - 1; k <= n && sum[k + 1][j - 1]; k++) {
        tot = (tot + (ll)f[i][k] * sum[k + 1][j - 1]) % MD;
      }
      if (!tot) break;
      dp[i][j] = tot;
    }
    dp[i][0] = dk[n - i];
    for (int j = 0; j <= n - i + 1; j++)
      sum[i][j] = (sum[i + 1][j] + dp[i][j]) % MD;
  }
  sum[1][0] = (sum[1][0] - 1 + MD) % MD;
  for (int i = 0; i <= n; i++)
    printf("%lld ", (sum[1][i] - sum[1][i + 1] + MD) % MD);
}
}  // namespace FA1
namespace FA2 {
int dp[2][N][1025];
ll g[N];
void fa2() {
  dp[0][0][0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = 0; j <= i && j <= n / c; j++) {
      for (int k = 0; k + 1 < (1 << c); k++) {
        dp[i & 1][j][k] = 0;
      }
    }
    for (int j = 0; j <= i && j <= n / c; j++) {
      for (int k = 0; k + 1 < (1 << c); k++) {
        if (!dp[(i & 1) ^ 1][k]) continue;
        dp[i & 1][j][k] = (dp[i & 1][j][k] + dp[(i & 1) ^ 1][j][k]) % MD;
        if ((k | (1 << (a[i] - 1))) == (1 << c) - 1) {
          dp[i & 1][j + 1][0] =
              (dp[i & 1][j + 1][0] + dp[(i & 1) ^ 1][j][k]) % MD;
        } else {
          dp[i & 1][j][k | (1 << (a[i] - 1))] =
              (dp[i & 1][j][k | (1 << (a[i] - 1))] + dp[(i & 1) ^ 1][j][k]) %
              MD;
        }
      }
    }
  }
  g[0] = MD - 1;
  for (int i = 0; i <= n; i++) {
    for (int j = 0; j < (1 << c); j++) {
      g[i] = (g[i] + dp[n & 1][i][j]) % MD;
    }
    printf("%lld ", g[i]);
  }
}
}  // namespace FA2
int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
  }
  if (c == 1) {
    using FA1::f;
    f[0][0] = 1;
    for (int i = 1; i <= n; i++) {
      f[i][0] = 1;
      for (int j = 1; j <= i; j++) {
        f[i][j] = (f[i - 1][j] + f[i - 1][j - 1]) % MD;
      }
    }
    printf("0 ");
    for (int i = 1; i <= n; i++) printf("%lld ", f[n][i]);
    return 0;
  }
  if (c <= 10)
    FA2::fa2();
  else
    FA1::fa1();
}
