#include <bits/stdc++.h>
using namespace std;
long long M = 998244353;
const int N = 3e3 + 7;
int mod = M;
int n, c;
int a[N];
int pw2[N], rpw[N], npw[N];
int tmp;
inline int pls(int a) {
  if (a > M) a -= M;
  if (a < 0) a += M;
  return a;
}
inline void mkay(int &a) {
  if (a >= mod)
    a -= mod;
  else if (a < 0)
    a += mod;
}
int pw(int a, int b) {
  int rt = 1;
  while (b) {
    if (b % 2) rt = (1ll * rt * a) % M;
    b /= 2;
    a = (1ll * a * a) % M;
  }
  return rt;
}
int u[2][N][4100];
int dp[N][N];
long long num[N][N];
int cnt[N];
int f[N];
int res[N];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  for (int i = 1; i < N; i++) {
    pw2[i] = ((pw2[i - 1] + 1) * 2 - 1) % M;
    rpw[i] = pw(pw2[i], M - 2) % M;
    npw[i] = (1ll * pw2[i] * rpw[i - 1]) % M;
  }
  cin >> n >> c;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    a[i]--;
  }
  if (c <= 12) {
    int k = n / c;
    u[0][0][0] = 1;
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
      int md = i & 1;
      int lmd = 1 - md;
      for (int t = 0; t <= i / c; t++) {
        if (t >= 1) dp[i][t] = u[lmd][t - 1][((1 << c) - 1) ^ (1 << a[i])];
        if (!t)
          u[md][t][0] = 1;
        else
          u[md][t][0] = (u[lmd][t][0] + dp[i][t]) % M;
        for (int msk = 1; msk < (1 << c); msk++) {
          if (!((msk >> a[i]) & 1))
            u[md][t][msk] = u[lmd][t][msk];
          else
            u[md][t][msk] = pls(u[lmd][t][msk] + u[lmd][t][msk] - M +
                                u[lmd][t][msk ^ (1 << a[i])]);
        }
      }
    }
  } else {
    dp[0][0] = 1;
    for (int i = 1; i <= n; i++) {
      memset(cnt, 0, sizeof cnt);
      int tmp = c - 1, shit = 1;
      for (int k = i - 1; k >= 0; k--) {
        int x = a[k + 1];
        if (x != a[i]) {
          cnt[x]++;
          if (cnt[x] == 1)
            tmp--;
          else
            shit = 1LL * shit * rpw[cnt[x]] % mod;
        }
        if (!tmp)
          for (int j = 1; j <= k / c + 1; j++)
            dp[i][j] = (dp[i][j] + 1LL * dp[k][j - 1] * shit) % mod;
      }
    }
  }
  for (int i = 1; i <= n; i++)
    for (int t = 1; t <= n / c; t++) {
      f[t] = 1ll * (f[t] + 1ll * dp[i][t] * (pw2[n - i] + 1)) % M;
    }
  cout << (((pw2[n] + 0 - f[1]) % M) + M) % M << ' ';
  for (int i = 1; i <= n; i++)
    cout << ((((f[i] - f[i + 1]) % M) + M) % M) << ' ';
}
