#pragma GCC optimize(2)
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int mod=998244353;
const unsigned long long lrg=17450252285413163007;
unsigned long long dp[3003][3003];
int n,c,a[3003],nd,CC[3003][3003],sum[3003][3003];
int f[2][3003][2048],cnt[3003][3003];
int tomulti[3003];
int pw[3003],invpw[3003];
long long mypow(long long x,long long times){
	if(times==0)return 1;
	long long ret=mypow(x,times/2);ret=ret*ret%mod;
	if(times%2)ret=ret*x%mod;return ret;
}
int vis[3003],finalans[3003],nei[3003][3003],CNT[3003];
int main(){
	freopen("a.in","r",stdin);
	pw[0]=0;
	for(register int i=1;i<3003;i++)pw[i]=pw[i-1]*2%mod+1;
	for(register int i=0;i<3003;i++)invpw[i]=mypow(pw[i],mod-2); 
	scanf("%d%d",&n,&c);
	for(register int i=0;i<n;i++)
		scanf("%d",a+i),a[i]--;
	int PW=1,NW=0,ANS=1;
	for(register int i=n-1;i>=-1;i--){
		tomulti[i+1]=PW-ANS;
		if(NW<c)tomulti[i+1]+=ANS;
		if(tomulti[i+1]<0)
			tomulti[i+1]+=mod;
		if(i==-1)break;
		PW*=2;if(PW>mod)PW-=mod;
		if(!vis[a[i]])NW++;
		else ANS=(ll)ANS*invpw[vis[a[i]]]%mod;
		vis[a[i]]++;
		ANS=(ll)ANS*pw[vis[a[i]]]%mod;
	}tomulti[n]=1;
//	for(int i=0;i<=n;i++)cout<<tomulti[i]<<' ';cout<<endl;
	for(register int i=0;i<n;i++){
		for(register int j=0;j<c;j++)vis[j]=0;
		vis[a[i]]=1;
		int ans=1,nw=1;
		for(register int j=i+1;j<n;j++){
			if(a[i]==a[j]){ans*=2;if(ans>=mod)ans-=mod;continue;}
			if(vis[a[j]])ans=(ll)ans*invpw[vis[a[j]]]%mod;
			if(vis[a[j]]==0)nw++;
			vis[a[j]]++;
			ans=(ll)ans*pw[vis[a[j]]]%mod;
			if(nw==c)cnt[i][j]=(ll)ans*invpw[vis[a[j]]]%mod;
		}
	}
	for(register int i=1;i<=n;i++)
		for(register int j=i+1;j<=n;j++)
			if(cnt[i-1][j-1])
				nei[j][CNT[j]++]=i;
	if(c>11){//n, n/c
		dp[0][0]=1;sum[0][0]=1;int mxn=1;
		for(register int i=1;i<=n;i++){
			for(register int j=1;j<=min(i/c+1,mxn);j++){
				for(register int k=0;k<CNT[i];k++){
					dp[i][j]=(dp[i][j]+(ll)sum[nei[i][k]-1][j-1]*cnt[nei[i][k]-1][i-1]);
					if(dp[i][j]>lrg)dp[i][j]%=mod;
				}dp[i][j]%=mod;
				sum[i][j]=sum[i-1][j]+dp[i][j];
				if(sum[i][j]>mod)sum[i][j]-=mod;
				if(sum[i][j])mxn=j+1;
			}sum[i][0]=1;
		}finalans[0]=-1;
		for(register int i=0;i<=n/c+1;i++)//c
			for(register int j=0;j<=n;j++)
				finalans[i]=(finalans[i]+(ll)dp[j][i]*tomulti[j])%mod;
		for(register int i=0;i<=n;i++)
			printf("%d ",finalans[i]);
		return 0;
	}
	if(c==1){
		CC[0][0]=1;
		for(register int i=1;i<3003;i++)
			for(register int j=0;j<3003;j++){
				CC[i][j]=CC[i-1][j];
				if(j)CC[i][j]+=CC[i-1][j-1],CC[i][j]%=mod;
			}
		cout<<0;
		for(register int i=1;i<=n;i++)
			printf(" %d",CC[n][i]);
		return 0;
	}
	f[0][0][0]=1;
	for(register int i=1;i<=n;i++)
		for(register int j=i/c+1;j>=0;j--){
			for(register int msk=0;msk<(1<<c);msk++)
				f[i%2][j][msk]=f[(i-1)%2][j][msk];
			for(register int msk=0;msk<(1<<c);msk++){
				f[i%2][j][msk|(1<<a[i-1])]+=f[(i-1)%2][j][msk];
				if(f[i%2][j][msk|(1<<a[i-1])]>=mod)
					f[i%2][j][msk|(1<<a[i-1])]-=mod;
			}
			f[i%2][j+1][0]+=f[i%2][j][(1<<c)-1];
			if(f[i%2][j+1][0]>=mod)f[i%2][j+1][0]-=mod; 
			f[i%2][j][(1<<c)-1]=0;
		}f[n%2][0][0]--;
	for(register int i=0;i<=n;i++){
		int cnt=0;
		for(int j=0;j<(1<<c);j++){
			cnt=cnt+f[n%2][i][j];
			if(cnt>=mod)cnt-=mod;
		}
		printf("%d ",cnt);
	}
}