#include <bits/stdc++.h>
using namespace std;
int n, m, c, a[3005];
int dp2[3005][3005];
inline int add(int a, int b) {
  int c = a + b;
  return c >= 998244353 ? c - 998244353 : c;
}
int solve1() { return 0; }
int solve2() {
  int c2 = 1 << c;
  long long ans;
  dp2[0][0] = 1;
  for (int i = 1; i <= n; ++i) {
    --a[i];
    for (int j = m; j >= 0; --j) {
      for (int msk = c2 - 1; msk >= 0; --msk) {
        if (msk & (1 << a[i])) {
          dp2[j][msk] =
              add(add(dp2[j][msk], dp2[j][msk]), dp2[j][msk - (1 << a[i])]);
        }
      }
      dp2[j + 1][0] = add(dp2[j + 1][0], dp2[j][c2 - 1]);
      dp2[j][c2 - 1] = 0;
    }
  }
  --dp2[0][0];
  for (int i = 0; i <= n; ++i) {
    ans = 0;
    for (int msk = 0; msk < c2; ++msk) {
      ans += dp2[i][msk];
    }
    printf("%lld ", ans % 998244353);
  }
  return 0;
}
int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= n; ++i) scanf("%d", a + i);
  m = n / c;
  return solve2();
  if (c > 20 || n < (1 << c)) return solve1();
  return solve2();
}
