#include <bits/stdc++.h>
using namespace std;
int n, c;
int a[3005];
int f[3005][3005];
int pwr2m1[3005];
int pwr2m1_inv[3005];
int pwr2m1_rep[3005];
int left[3005];
int tmp[3005];
int prod[3005][3005];
int f2[2][305][1024];
int fpow(int base, int exponent) {
  int ans = 1;
  int cur = base;
  while (exponent) {
    if (exponent & 1) ans = (((long long)(ans) * (long long)(cur)) % 998244353);
    cur = (((long long)(cur) * (long long)(cur)) % 998244353);
    exponent >>= 1;
  }
  return ans;
}
int main() {
  for (int i = 1; i <= 3000; i++) {
    pwr2m1[i] =
        ((((long long)(pwr2m1[i - 1]) * (long long)(2)) % 998244353) + 1) %
        998244353;
    pwr2m1_inv[i] = fpow(pwr2m1[i], 998244353 - 2);
    pwr2m1_rep[i] =
        (((long long)(pwr2m1[i]) * (long long)(pwr2m1_inv[i - 1])) % 998244353);
  }
  pwr2m1_rep[1] = 1;
  scanf("%d%d", &n, &c);
  f[0][0] = 1;
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    f[0][i] = (pwr2m1[i] + 1) % 998244353;
  }
  if (c > 10) {
    int lptr = 1;
    int remain = c;
    for (int i = 1; i <= n; i++) {
      if (!tmp[a[i]]) remain--;
      tmp[a[i]]++;
      if (!remain) {
        while (tmp[a[lptr]] >= 2) {
          tmp[a[lptr]]--;
          lptr++;
        }
        left[i] = lptr;
      }
    }
    for (int r = 1; r <= n; r++) {
      int curprod = 1;
      for (int i = 1; i <= c; i++) tmp[i] = 0;
      for (int l = r; l >= 1; l--) {
        tmp[a[l]]++;
        curprod = (((long long)(curprod) * (long long)(pwr2m1_rep[tmp[a[l]]])) %
                   998244353);
        prod[l][r] =
            (((long long)(curprod) * (long long)(pwr2m1_inv[tmp[a[l]]])) %
             998244353);
      }
    }
    for (int d = 1; d <= n / c; d++) {
      for (int i = d * c; i <= n; i++) {
        for (int j = left[i]; j >= (d - 1) * c; j--) {
          f[d][i] += (((long long)(f[d - 1][j - 1]) * (long long)(prod[j][i])) %
                      998244353);
          if (f[d][i] >= 998244353) f[d][i] -= 998244353;
        }
      }
    }
    for (int i = 0; i <= n; i++) {
      printf("%d ", (f[i][n] - f[i + 1][n] - (i == 0 ? 1 : 0) + 998244353) %
                        998244353);
    }
  } else {
    for (int i = 1; i <= n; i++) a[i] = (1 << (a[i] - 1));
    f2[0][0][0] = 1;
    for (int i = 0; i < n; i++) {
      int old = (i & 1);
      int nw = (old ^ 1);
      for (int j = 0; j <= i / c; j++) {
        for (int k = 0; k < (1 << c); k++) {
          f2[nw][j][k] += f2[old][j][k];
          if (f2[nw][j][k] >= 998244353) f2[nw][j][k] -= 998244353;
          int new_bits = k | a[i + 1];
          if (new_bits == ((1 << c) - 1)) {
            f2[nw][j + 1][0] += f2[old][j][k];
            if (f2[nw][j + 1][0] >= 998244353) f2[nw][j + 1][0] -= 998244353;
          } else {
            f2[nw][j][new_bits] += f2[old][j][k];
            if (f2[nw][j][new_bits] >= 998244353)
              f2[nw][j][new_bits] -= 998244353;
          }
          f2[old][j][k] = 0;
        }
      }
    }
    for (int i = 0; i <= n; i++) {
      int ans = 0;
      for (int j = 0; j < (1 << c); j++) {
        ans += f2[n & 1][i][j];
        if (ans >= 998244353) ans -= 998244353;
      }
      if (i == 0) {
        ans--;
        if (ans < 0) ans += 998244353;
      }
      printf("%d ", ans);
    }
  }
  return 0;
}
