#include<bits/stdc++.h>
#pragma GCC diagnostic error "-std=c++11"
#pragma GCC target("avx")
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
#pragma GCC optimize("inline")
#pragma GCC optimize("-fgcse")
#pragma GCC optimize("-fgcse-lm")
#pragma GCC optimize("-fipa-sra")
#pragma GCC optimize("-ftree-pre")
#pragma GCC optimize("-ftree-vrp")
#pragma GCC optimize("-fpeephole2")
#pragma GCC optimize("-ffast-math")
#pragma GCC optimize("-fsched-spec")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("-falign-jumps")
#pragma GCC optimize("-falign-loops")
#pragma GCC optimize("-falign-labels")
#pragma GCC optimize("-fdevirtualize")
#pragma GCC optimize("-fcaller-saves")
#pragma GCC optimize("-fcrossjumping")
#pragma GCC optimize("-fthread-jumps")
#pragma GCC optimize("-funroll-loops")
#pragma GCC optimize("-fwhole-program")
#pragma GCC optimize("-freorder-blocks")
#pragma GCC optimize("-fschedule-insns")
#pragma GCC optimize("inline-functions")
#pragma GCC optimize("-ftree-tail-merge")
#pragma GCC optimize("-fschedule-insns2")
#pragma GCC optimize("-fstrict-aliasing")
#pragma GCC optimize("-fstrict-overflow")
#pragma GCC optimize("-falign-functions")
#pragma GCC optimize("-fcse-skip-blocks")
#pragma GCC optimize("-fcse-follow-jumps")
#pragma GCC optimize("-fsched-interblock")
#pragma GCC optimize("-fpartial-inlining")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("-freorder-functions")
#pragma GCC optimize("-findirect-inlining")
#pragma GCC optimize("-fhoist-adjacent-loads")
#pragma GCC optimize("-frerun-cse-after-loop")
#pragma GCC optimize("inline-small-functions")
#pragma GCC optimize("-finline-small-functions")
#pragma GCC optimize("-ftree-switch-conversion")
#pragma GCC optimize("-foptimize-sibling-calls")
#pragma GCC optimize("-fexpensive-optimizations")
#pragma GCC optimize("-funsafe-loop-optimizations")
#pragma GCC optimize("inline-functions-called-once")
#pragma GCC optimize("-fdelete-null-pointer-checks")
using namespace std;
typedef long long ll;
const int mod=998244353;
const long long lrg=8226880248558387199;
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()
{
	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;
			}
			else
			{
				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)
	{
		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 , mxn) ; j++)
			{
				for(register int k = 0 ; k < CNT[i] ; k++)
				{
					dp[i][j] = (dp[i][j] + 1ll * 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++)
		{
			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&1][j][msk]=f[(i-1)&1][j][msk];
			}
			for(register int msk=0;msk<(1<<c);msk++)
			{
				f[i&1][j][msk|(1<<a[i-1])]+=f[(i-1)&1][j][msk];
				if(f[i&1][j][msk|(1<<a[i-1])]>=mod)
				{
					f[i&1][j][msk|(1<<a[i-1])]-=mod;
				}
			}
			f[i&1][j+1][0]+=f[i^1][j][(1<<c)-1];
			if(f[i&1][j+1][0]>=mod)
			{
				f[i&1][j+1][0]-=mod; 
			}
			f[i & 1][j][(1<<c)-1]=0;
		}
	}
	f[n & 1][0][0]--;
	for(register int i = 0 ; i <= n ; i ++)
	{
		int cnt=0;
		for(register int j = 0 ; j < (1 << c) ; j++)
		{
			cnt += f[n & 1][i][j];
			if(cnt >= mod)
			{
				cnt -= mod;
			}
		}
		printf("%d ",cnt);
	}
}