#include<bits/stdc++.h>
using namespace std;
#define re register
const int blk=11,mod=998244353;int n,c,pre[3010][3010],f[3010][3010],cnt[3010],a[3010],ex[3010],inv[3010],ans[3010];int exx(re int a,re int b){	int ans=1;	for(;b;b>>=1,a=(long long)a*a%mod)if(b&1)ans=(long long)ans*a%mod;	return ans;}void dp(){	f[0][0]=1;	for(re int i=1;i<=n;i++)	{		memset(cnt,0,sizeof(cnt));		cnt[i]=1;		int now=1,num=1;		for(re int j=i;j;j--)		{			if(a[j]!=a[i])			{				if(!cnt[a[j]])num++;				cnt[a[j]]++;				now=(long long)now*inv[cnt[a[j]]-1]%mod*(ex[cnt[a[j]]]-1)%mod;			}			if(num==c)pre[j][i]=now;		}	}	for(re int i=0;i<n/c;i++)	{		for(re int j=0;j<n;j++)		if(f[i][j]){			for(re int k=j+1;k<=n;k++)				if(pre[j+1][k])				{					f[i+1][k]=(f[i+1][k]+(long long)f[i][j]*pre[j+1][k])%mod;				}		}	}}int g[3010][(1<<blk)+11];void force(){	re int C=(1<<c)-1;	g[0][0]=1;	for(int i=1;i<=n;i++)	{		for(int j=n/c;j>=0;j--)		{			for(int S=C-1;S>=0;S--)if(g[j][S])			{				g[j][S|(1<<(a[i]-1))]=(g[j][S|(1<<(a[i]-1))]+g[j][S])%mod;			}g[j+1][0]=(g[j+1][0]+g[j][C])%mod;f[j+1][i]=g[j][C];g[j][C]=0;		}	}}int main(){	scanf("%d%d",&n,&c);	for(re int i=1;i<=n;i++)scanf("%d",&a[i]);	ex[0]=inv[0]=1;	for(re int i=1;i<=n;i++)	{		ex[i]=ex[i-1]*2%mod;inv[i]=exx(ex[i]-1+mod,mod-2);	}	if(c<=blk)force();	else dp();	for(int i=1;i*c<=n;i++)		for(int j=1;j<=n;j++)			ans[i]=(ans[i]+(long long)f[i][j]*ex[n-j])%mod;	ans[0]=ex[n]-1;	for(int i=0;i<=n;i++)printf("%d ",(ans[i]-ans[i+1]+mod)%mod);}