#include <bits/stdc++.h>
using namespace std;
int n, m, c, a[3005];
int stp[3005], cnt[3005], im2[3005], m2[3005];
long long ans[3005], nxt[3005][3005], dp[3005][3005];
inline long long add(long long a, long long b) {
  int c = a + b;
  return c >= 998244353 ? c - 998244353 : c;
}
inline int mi(int a, int p) {
  int r = 1;
  while (p) {
    if (p & 1) r = 1ll * r * a % 998244353;
    a = 1ll * a * a % 998244353;
    p >>= 1;
  }
  return r;
}
signed solve1() {
  m2[0] = 0;
  for (int i = 1; i <= n; ++i) {
    m2[i] = add(m2[i - 1] << 1, 1);
    im2[i] = mi(m2[i], 998244353 - 2);
  }
  int c0, cur;
  for (int i = 0; i <= n; ++i) {
    c0 = c;
    cur = 1;
    for (int j = 1; j <= c; ++j) cnt[j] = 0;
    for (int j = i + 1; j <= n; ++j) {
      ++cnt[a[j]];
      if (cnt[a[j]] == 1)
        --c0;
      else
        cur = 1ll * cur * im2[cnt[a[j]] - 1] % 998244353;
      if (c0 == 0) {
        if (stp[i] == 0) stp[i] = j;
        nxt[i][j] = cur;
      }
      cur = 1ll * cur * m2[cnt[a[j]]] % 998244353;
    }
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= m; ++j) {
      for (int k = stp[i]; k <= n; ++k) {
        dp[k][j + 1] += dp[i][j] * nxt[i][k];
        if (dp[k][j + 1] > 7e18) dp[k][j + 1] %= 998244353;
      }
    }
  }
  for (int i = 0; i <= m; ++i) {
    for (int j = 0; j <= n; ++j) {
      ans[i] += dp[j][i] % 998244353 * (m2[n - j] + 1) % 998244353;
    }
    if (i == 0) ans[0] += 998244353 - 1;
    ans[i] %= 998244353;
  }
  for (int i = 0; i <= n; ++i) {
    printf("%lld ", add(ans[i], 998244353 - ans[i + 1]));
  }
  return 0;
}
signed solve2() {
  int c2 = 1 << c;
  long long ans, tmp;
  dp[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    --a[i];
    for (int j = m; j >= 0; --j) {
      for (int msk = c2 - 1; msk >= 0; --msk) {
        if (msk & (1 << a[i])) {
          tmp = dp[j][msk] << 1;
          if (tmp >= 998244353) tmp -= 998244353;
          dp[j][msk] = add(tmp, dp[j][msk - (1 << a[i])]);
        }
      }
      dp[j + 1][0] = add(dp[j + 1][0], dp[j][c2 - 1]);
      dp[j][c2 - 1] = 0;
    }
  }
  --dp[0][0];
  for (int i = 0; i <= n; ++i) {
    ans = 0;
    for (int msk = 0; msk < c2; ++msk) ans += dp[i][msk];
    printf("%lld ", ans % 998244353);
  }
  return 0;
}
signed main() {
  scanf("%lld%lld", &n, &c);
  for (int i = 1; i <= n; ++i) scanf("%lld", a + i);
  m = n / c;
  if (c > 20 || n < (1 << c)) return solve1();
  return solve2();
}
