#include <bits/stdc++.h>
using namespace std;
template <typename T>
void maxtt(T& t1, T t2) {
  t1 = max(t1, t2);
}
template <typename T>
void mintt(T& t1, T t2) {
  t1 = min(t1, t2);
}
bool debug = 0;
int n, m, k;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
string direc = "URDL";
long long ln, lk, lm;
void etp(bool f = 0) {
  puts(f ? "YES" : "NO");
  exit(0);
}
void addmod(int& x, int y, int mod = 998244353) {
  assert(y >= 0);
  x += y;
  if (x >= mod) x -= mod;
  assert(x >= 0 && x < mod);
}
void et(int x = -1) {
  printf("%d\n", x);
  exit(0);
}
long long fastPow(long long x, long long y, int mod = 998244353) {
  long long ans = 1;
  while (y > 0) {
    if (y & 1) ans = (x * ans) % mod;
    x = x * x % mod;
    y >>= 1;
  }
  return ans;
}
long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; }
int a[3005], c;
int dp[3005][3005], num[3005][3005], cnt[3005];
int inv2[3005], v2[3005];
void comb(int n) {
  dp[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    dp[i][0] = dp[i][i] = 1;
    for (int j = 1; j < i; j++) {
      dp[i][j] = (dp[i - 1][j - 1] + dp[i - 1][j]) % 998244353;
    }
  }
}
void calA() {
  for (int i = 0; i <= n; i++) {
    v2[i] = (fastPow(2, i) + 998244353 - 1) % 998244353;
    inv2[i] = fastPow(v2[i], 998244353 - 2);
  }
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    int tmp = 1, add = 0;
    for (int(i) = 1; (i) <= (int)(c); (i)++) cnt[i] = 0;
    for (int j = i; j <= n; j++) {
      cnt[a[j]]++;
      if (cnt[a[j]] == 1) {
        add++;
        if (add == c) {
          for (int(z) = 1; (z) <= (int)(c); (z)++)
            tmp = (long long)tmp * v2[cnt[z]] % 998244353;
          num[i][j] = (long long)tmp * inv2[cnt[a[j]]] % 998244353;
          continue;
        }
      }
      if (add == c) {
        tmp = (long long)tmp * inv2[cnt[a[j]] - 1] % 998244353;
        num[i][j] = tmp;
        tmp = (long long)tmp * v2[cnt[a[j]]] % 998244353;
      }
    }
  }
  if (c == 11) {
    printf("%d\n", k);
    exit(0);
  }
  dp[0][0] = 1;
  for (int(t) = 1; (t) <= (int)(k); (t)++) {
    for (int(i) = 1; (i) <= (int)(n); (i)++) {
      for (int j = 0; j < i; j++)
        if (dp[t - 1][j]) {
          addmod(dp[t][i], (long long)dp[t - 1][j] * num[j + 1][i] % 998244353);
        }
    }
  }
}
int u[1501][(1 << 10) + 5];
void calB() {
  u[0][0] = 1;
  dp[0][0] = 1;
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    for (int(t) = 1; (t) <= (int)(k); (t)++)
      dp[t][i] = u[t - 1][((1 << c) - 1) ^ (1 << (a[i] - 1))];
    for (int ms = (1 << c) - 1; ms >= 0; ms--)
      if ((ms >> (a[i] - 1)) & 1)
        for (int x = 0; x <= min(k - 1, (i / c)); x++) {
          addmod(u[x][ms], u[x][ms]);
          addmod(u[x][ms], u[x][ms ^ (1 << (a[i] - 1))]);
        }
    for (int x = 0; x <= k; x++) {
      addmod(u[x][0], dp[x][i]);
    }
  }
}
void fmain(int tid) {
  scanf("%d%d", &n, &c);
  for (int(i) = 1; (i) <= (int)(n); (i)++) scanf("%d", a + i);
  int cnt = 0;
  vector<bool> used(n + 5, 0);
  for (int(i) = 1; (i) <= (int)(n); (i)++) {
    if (!used[a[i]]) {
      used[a[i]] = 1;
      cnt++;
    }
    if (cnt == c) {
      cnt = 0;
      for (int(i) = 1; (i) <= (int)(c); (i)++) used[i] = 0;
      k++;
    }
  }
  if (c == 1) {
    comb(n);
    printf("0 ");
    for (int(i) = 1; (i) <= (int)(n); (i)++) printf("%d ", dp[n][i]);
    return;
  }
  if (c <= 10)
    calB();
  else
    calA();
  vector<int> f(n + 5, 0);
  for (int(t) = 0; (t) < (int)(k + 1); (t)++) {
    for (int i = 0; i <= n; i++) {
      addmod(f[t], (long long)dp[t][i] * fastPow(2, n - i) % 998244353);
    }
  }
  addmod(f[0], 998244353 - 1);
  for (int t = 0; t <= n; t++) {
    printf("%d ", (f[t] - f[t + 1] + 998244353) % 998244353);
  }
}
int main() {
  int t = 1;
  for (int(i) = 1; (i) <= (int)(t); (i)++) {
    fmain(i);
  }
  return 0;
}
