#include <iostream>
#include <cstdio>
#include <cstring>
#define ll unsigned long long
#define int unsigned int
#define MD 998244353
#define md(_o) ((_o >= MD) ? (_o)-MD : (_o))
using namespace std;

int n, c;

inline ll pwer(ll a, ll b, ll ret = 1ll) {
	for ( ; b; b >>= 1, a = a * a % MD)
		if (ret & 1) ret = ret * a % MD;
	return ret;
}

namespace ywy{
	ll dk[3333], dk1[3333], invdk[3333], invdk1[3333];
    int a[3333], cnt[3333];
    ll sum[3333][3333], g[3333];
    int f[3333][3333], dp[3333][3333];
	namespace FA2{
		int dp[2][3333][1024];
		void fa2() {
            dp[0][0][0] = 1;
            for (register int i = 1; i <= n; i++) {
                for (register int j = 0; j <= i && j <= n / c; j++) {
                    for (register int k = 0; k + 1 < (1 << c); k++) dp[i & 1][j][k] = 0;
                }
                for (register int j = 0; j <= i && j <= n / c; j++) {
                    for (register int k = 0; k + 1 < (1 << c); k++) {
                        if (!dp[(i & 1) ^ 1][j][k])
                            continue;
                        dp[i & 1][j][k] = md(dp[i & 1][j][k] + dp[(i & 1) ^ 1][j][k]);
                        if ((k | (1 << (a[i] - 1))) == (1 << c) - 1) {
                            dp[i & 1][j + 1][0] = md(dp[i & 1][j + 1][0] + dp[(i & 1) ^ 1][j][k]);
                        } else {
                            dp[i & 1][j][k | (1 << (a[i] - 1))] =
                                md(dp[i & 1][j][k | (1 << (a[i] - 1))] + dp[(i & 1) ^ 1][j][k]);
                        }
                    }
                }
            }
            g[0] = MD - 1;
            for (register int i = 0; i <= n; i++) {
                for (register int j = 0; j < (1 << c); j++) {
                    g[i] = (g[i] + dp[n & 1][i][j]) % MD;
                }
                printf("%lld ", g[i]);
            }
        }
	}
	void ywymain() {
	    cin >> n >> c;
	    for (register int i = 1; i <= n; i++) cin >> a[i];
		if (c == 1) {
			f[0][0] = 1;
			for (register int i = 1; i <= n; i++) {
				f[i][0] = 1;
				for (register int j = 1; j <= i; j++) f[i][j] = (f[i - 1][j] + f[i - 1][j - 1]) % MD;
			}
			printf("0 ");
			for (register int i = 1; i <= n; i++) printf("%d ", f[n][i]);
			return;
		}
		dp[n + 1][0] = 1;
		dk[0] = 1;
		invdk[0] = 1;
		invdk1[0] = 1; // attention
		for (register int i = 1; i <= n; i++) {
			dk[i] = (dk[i - 1] << 1) % MD; // [debug]
			dk1[i] = dk[i] - 1; // [debug]
			invdk[i] = pwer(dk[i], MD - 2);
			invdk1[i] = pwer(dk1[i], MD - 2);
		}
        if (c <= 10) {
            FA2::fa2();
            return;
        }
		for (register int l = 1; l <= n; l++) { // [debug]
			memset(cnt, 0, sizeof(cnt));
			int tot = 1;
			ll ji = 1;
			cnt[a[l]] = 1;

			for (register int r = l + 1; r <= n; r++) {
				if (a[r] == a[l]) {
					ji *= 2;
					ji %= MD;
				} else {
					ji *= invdk1[cnt[a[r]]];
					ji %= MD;
					cnt[a[r]]++;
					ji *= dk1[cnt[a[r]]];
					ji %= MD;
					if (cnt[a[r]] == 1) 
						tot++;
				}
				if (tot == c && a[r] != a[l])
					f[l][r] = (ji * invdk1[cnt[a[r]]]) % MD;
			}
		}
		sum[n + 1][0] = 1;
		for (register int i = n; i >= 1; i--) {
			for (register int j = 1; j <= n - i + 1; j++) {
				ll tot = 0;
				for (register int k = i + c - 1; k <= n && sum[k + 1][j - 1]; k++)
					tot = (tot + (ll)f[i][k] * sum[k + 1][j - 1]) % MD;
				if (!tot) 
					break; // 剪枝 qwq
				dp[i][j] = tot;
			}
			dp[i][0] = dk[n - i];
			for (register int j = 0; j <= n - i + 1; j++) sum[i][j] = (sum[i + 1][j] + dp[i][j]) % MD;
		}
		sum[1][0]--;
		for (register int i = 0; i <= n; i++) printf("%lld ", (sum[1][i] + MD - sum[1][i + 1]) % MD);
	}
}
signed main() {
    ywy::ywymain();
    return (0);
}