#include <bits/stdc++.h>
using namespace std;
inline int read() {
  char ch = getchar();
  int nega = 1;
  while (!isdigit(ch)) {
    if (ch == '-') nega = -1;
    ch = getchar();
  }
  int ans = 0;
  while (isdigit(ch)) {
    ans = ans * 10 + ch - 48;
    ch = getchar();
  }
  if (nega == -1) return -ans;
  return ans;
}
void print(vector<int> x) {
  for (int i = 0; i < (int)x.size(); i++)
    printf("%d%c", x[i], " \n"[i == (int)x.size() - 1]);
}
inline int add(int x, int y) {
  return x + y >= 998244353 ? x + y - 998244353 : x + y;
}
inline int add(int x, int y, int z) { return add(add(x, y), z); }
inline int sub(int x, int y) { return x - y < 0 ? x - y + 998244353 : x - y; }
inline int mul(int x, int y) { return 1LL * x * y % 998244353; }
inline int mul(int x, int y, int z) { return mul(mul(x, y), z); }
int qpow(int x, int y) {
  int ans = 1;
  while (y) {
    if (y & 1) ans = mul(ans, x);
    x = mul(x, x);
    y >>= 1;
  }
  return ans;
}
int Inv(int x) { return qpow(x, 998244353 - 2); }
namespace QAQ {
int f[3005][3005], a[3005], cnt[3005], pw[3005], ipw[3005], ans[3005];
int qwq[3005], qaq[3005];
void Main(int n, int c) {
  for (int i = 1; i <= n; i++) a[i] = read();
  f[0][0] = 1;
  pw[0] = 1;
  for (int i = 1; i < 3005; i++) pw[i] = mul(pw[i - 1], 2);
  for (int i = 0; i < 3005; i++) pw[i] = sub(pw[i], 1);
  for (int i = 0; i < 3005; i++) ipw[i] = Inv(pw[i]);
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= i / c; j++) {
      int x = 0, ans = 1;
      for (int k = i; k >= 1; k--) {
        if (a[k] == a[i]) {
          if (x == c - 1) f[i][j] = add(f[i][j], mul(ans, f[k - 1][j - 1]));
          continue;
        }
        if (!cnt[a[k]])
          x++;
        else
          ans = mul(ans, ipw[cnt[a[k]]]);
        cnt[a[k]]++;
        ans = mul(ans, pw[cnt[a[k]]]);
        if (x == c - 1) f[i][j] = add(f[i][j], mul(ans, f[k - 1][j - 1]));
      }
      for (int k = i; k >= 1; k--)
        if (a[k] != a[i]) cnt[a[k]]--;
    }
  }
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) cnt[a[j]]++;
    int tmp = pw[n - i] + 1, res = 1;
    for (int j = 1; j <= c; j++) {
      if (!cnt[j])
        res = 0;
      else
        res = mul(res, pw[cnt[a[j]]]);
    }
    tmp = sub(tmp, res);
    for (int j = 1; j <= n; j++) ans[j] = add(ans[j], mul(tmp, f[i][j]));
    for (int j = i + 1; j <= n; j++) cnt[a[j]]--;
  }
  ans[0] = pw[n];
  for (int i = 1; i <= n; i++) ans[0] = sub(ans[0], ans[i]);
  for (int i = 0; i <= n; i++) printf("%d%c", ans[i], " \n"[i == n]);
}
};  // namespace QAQ
namespace QWQ {
const int S = 12;
int f[3005][1 << S], g[3005][1 << S], a[3005];
void Main(int n, int c) {
  for (int i = 1; i <= n; i++) a[i] = read() - 1;
  f[0][0] = 1;
  int lim = (1 << c) - 1;
  for (int i = 1; i <= n; i++) {
    memset(g, 0, sizeof(g));
    for (int j = 0; j <= i / c; j++) {
      for (int k = 0; k < (1 << c); k++) {
        if ((k | (1 << a[i])) == lim)
          g[j + 1][0] = add(g[j + 1][0], f[j][k]);
        else
          g[j][k | (1 << a[i])] = add(g[j][k | (1 << a[i])], f[j][k]);
        g[j][k] = add(g[j][k], f[j][k]);
      }
    }
    memcpy(f, g, sizeof(f));
  }
  for (int i = 0; i <= n; i++) {
    int ans = 0;
    for (int j = 0; j <= lim; j++) ans = add(ans, g[i][j]);
    if (i == 0) ans = sub(ans, 1);
    printf("%d%c", ans, " \n"[i == n]);
  }
}
};  // namespace QWQ
signed main() {
  int n, c;
  cin >> n >> c;
  if (c >= 13)
    QAQ::Main(n, c);
  else
    QWQ::Main(n, c);
  return 0;
}
