#include <bits/stdc++.h>
using namespace std;
const int Max_N = 3e3;
const long long Mod = 998244353;
int n, c, a[Max_N + 5], cnt[Max_N + 5], P[Max_N + 5], w[Max_N + 5][Max_N + 5];
long long f[Max_N + 5][Max_N + 5];
int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  P[0] = 1;
  for (int i = 1; i <= n; i++) P[i] = P[i - 1] * 2 % Mod;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= c; j++) cnt[j] = 0;
    for (int j = i, num = c; j <= n; j++) {
      if (cnt[a[j]] == 0) --num;
      ++cnt[a[j]];
      if (num == 0) {
        w[i][j] = 1;
        for (int k = 1; k <= c; k++)
          if (k != a[j]) w[i][j] = 1ll * w[i][j] * (P[cnt[k]] - 1 + Mod) % Mod;
      }
    }
  }
  for (int i = 1; i <= c; i++) cnt[i] = 0;
  for (int i = 1, num = c; i <= n; i++) {
    if (cnt[a[i]] == 0) --num;
    ++cnt[a[i]];
    if (num == 0) {
      long long tot = 1, sum = 1;
      for (int j = 1; j <= c; j++)
        if (j == a[i]) {
          tot = tot * P[cnt[j] - 1] % Mod, sum = sum * P[cnt[j] - 1] % Mod;
        } else {
          tot = tot * P[cnt[j]] % Mod;
          sum = sum * (P[cnt[j]] - 1 + Mod) % Mod;
        }
      f[i][0] = (tot - sum + Mod) % Mod;
    } else
      f[i][0] = P[i - 1];
  }
  int Mx = n / c;
  f[0][0] = 1;
  for (int i = 1; i <= n; i++)
    for (int j = 0; j <= Mx; j++)
      for (int k = 0; k < i; k++)
        f[i][j + 1] = (f[i][j + 1] + f[k][j] * w[k + 1][i]) % Mod;
  for (int i = 0; i <= n; i++) {
    long long ans = 0;
    for (int j = 1; j <= n; j++) ans = (ans + f[j][i]) % Mod;
    printf("%lld ", ans);
  }
  puts("");
  return 0;
}
