#include<cstdio>
#include<ctime>

typedef long long ll;
const int maxn = 3005;
const ll mod = 998244353;

int st = clock();
int n, c, a[maxn];
ll Fac[maxn], Inv[maxn];

inline ll fsp(ll a, ll b, const ll &mod = mod, ll res = 1) {
	for(a %= mod, b %= mod - 1; b; a = a * a % mod, b >>= 1)
		b & 1 && (res = res * a % mod); return res;
}

inline ll binom(int n, int m) { return Fac[n] * Inv[m] % mod * Inv[n - m] % mod; }

namespace Sub1 {		// O(n^3/c))
	int p, cnt[maxn];
	
	ll pw[maxn], inv[maxn], ans[maxn];
	int g[maxn][maxn], f[maxn][maxn];
	void main() {
		p = n / c;
		
		pw[0] = 1;
		for(int i = 1; i <= n; ++i) {
			pw[i] = pw[i - 1] * 2 % mod;
			inv[i] = fsp(pw[i] - 1, mod - 2);
		}
		
		for(int l = 1; l <= n; ++l) {
			for(int i = 1; i <= c; ++i) cnt[i] = 0;
			
			ll cur = 1, tmp = 0;
			for(int r = l; r <= n; ++r) {
				if(tmp == c) {
					g[l][r] = cur = cur * inv[cnt[a[r]]] % mod;
					cur = cur * (pw[cnt[a[r]] + 1] - 1) % mod;
				} else if(tmp == c - 1 && !cnt[a[r]]) {
					for(int i = 1; i <= c; ++i)
						if(i != a[r]) cur = cur * (pw[cnt[i]] - 1) % mod;
					g[l][r] = cur, cur = cur * (pw[cnt[a[r]] + 1] - 1) % mod;
				} if(!cnt[a[r]]++) ++tmp;
			}
		}
		
		f[0][0] = 1;
		for(int i = 1; i <= n; ++i)
			for(int j = 1; j <= p; ++j)
				for(int k = 0; k < i; ++k)
					if(f[k][j - 1] && g[k + 1][i])
						f[i][j] = (f[i][j] + 1ll * f[k][j - 1] * g[k + 1][i]) % mod;
		
		for(int t = 0; t <= p; ++t)
			for(int i = 0; i <= n; ++i)
				ans[t] = (ans[t] + f[i][t] * pw[n - i]) % mod;
		
		--ans[0];
		for(int i = 0; i <= n; ++i)
			printf("%lld ", (ans[i] - ans[i + 1] + mod) % mod);
	}
}

inline int Add(int x, int y) { (x += y) >= mod && (x -= mod); return x; }
inline int Mnu(int x, int y) { (x -= y) < 0 && (x += mod); return x; }
inline void Inc(int &x, int y) { (x += y) >= mod && (x -= mod); }

namespace Sub2 {		// O(n^2 2^c/c))
	int dp[2][maxn][maxn];
	int ans[maxn]; int cur = 0;
	void main() {
		for(int i = 1; i <= n; ++i) --a[i];
		
		dp[cur][0][0] = 1; int U = (1 << c) - 1;
		for(int i = 1; i <= n; ++i) {
			cur ^= 1;
			for(int t = 0; t <= i / c; ++t) {
				for(int S = 0; S < U; ++S) {
					dp[cur][t][S] = dp[cur ^ 1][t][S];
					if(!S) Inc(dp[cur][t][S], dp[cur ^ 1][t - 1][U ^ (1 << a[i])]);
					else if(S >> a[i] & 1)
						Inc(dp[cur][t][S], Add(dp[cur ^ 1][t][S], dp[cur ^ 1][t][S ^ (1 << a[i])]));
					Inc(ans[t], Mnu(dp[cur][t][S], dp[cur ^ 1][t][S]));
				}
			}
		}
		
		for(int t = 0; t <= n; ++t)
			printf("%lld ", ans[t]);
	}
}

int main() {
	scanf("%d%d", &n, &c);
	for(int i = 1; i <= n; ++i)
		scanf("%d", &a[i]);
	
	Fac[0] = 1;
	for(int i = 1; i <= n; ++i)
		Fac[i] = Fac[i - 1] * i % mod;
	Inv[n] = fsp(Fac[n], mod - 2);
	for(int i = n; i >= 1; --i)
		Inv[i - 1] = Inv[i] * i % mod;
	
	if(c == 1) {
		for(int i = 0; i <= n; ++i)
			printf("%d ", binom(n, i) - (!i));
		return 0;
	}
	
	if(c > 10) Sub1::main();
	else Sub2::main();
}