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