#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        if (!cnt[a[j]]) tot+=!cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
//    debug_arr2(dp,5,6);
//    debug_arr2(num,5,5);
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
//    if (c<=B) work_2(); else work_1();
    work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4015],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i-c+1) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) now=1ll*now*(P[cnt[k]]-1)%_p;
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        num[i][j]=now=1ll*inv[cnt[a[j]]]*now%_p;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) tmp+=1ll*dp[t-1][j]*num[j+1][i];
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=5005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]];
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,1,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
//    debug_arr2(dp,5,6);
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i-c+1) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i-c+1) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(register int i=(a); i<(b); i++)
#define per(i, a, b) for(register int i=(b)-1; i>=(a); i--)
typedef long long ll;
#define mem(a,x) memset(a,x,sizeof(a))

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;
inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { ll t=(ll)x*y; return t<_p?t:t%_p; }
inline void Add(int &x,int y) { x+=y; if (x>=_p) x-=_p; }
inline void Mul(int &x,int y) { ll t=(ll)x*y; x=(t<_p?t:t%_p);}
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue;;
        Mul(now,inv[cnt[a[j]]-1]),num[i][j]=now,Mul(now,P[cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t*c,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { ll t=(ll)x*y; return t<_p?t:t%_p; }
inline void Add(int &x,int y) { x+=y; if (x>=_p) x-=_p; }
inline void Mul(int &x,int y) { ll t=(ll)x*y; x=(t<_p?t:t%_p);}
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t*c,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) now=1ll*now*(P[cnt[k]]-1)%_p;
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        num[i][j]=now=1ll*inv[cnt[a[j]]]*now%_p;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i-c+1) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { rep(kk,1,c+1) cnt[kk]=0; continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Add(u[t][mask],(2ll*u[t][mask]+u[t][mask^(1<<(a[i]-1))])%_p);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S,tot[N],mk[15][N],mask;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    per(mask,1,S+1) rep(j,0,c) if (mask>>j&1) mk[j+1][++tot[j+1]]=mask;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(kk,1,tot[a[i]]+1) mask=mk[a[i]][kk],u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e17;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
//    debug_arr2(dp,10,10);
//    debug_arr2(num,10,10);
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
//    if (c<=B) work_2(); else work_1();
    work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
typedef long long ll;
#define mem(a,x) memset(a,x,sizeof(a))

const int N=3005,_p=998244353,B=13;
const ll oo=1e15;
inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { ll t=(ll)x*y; return t<_p?t:t%_p; }
inline void Add(int &x,int y) { x+=y; if (x>=_p) x-=_p; }
inline void Mul(int &x,int y) { ll t=(ll)x*y; x=(t<_p?t:t%_p);}
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][8200],P[N],inv[N],K,S,tot[N],mk[15][N],mask;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*(c+1)); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue;;
        Mul(now,inv[cnt[a[j]]-1]),num[i][j]=now,Mul(now,P[cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    per(mask,1,S+1) rep(j,0,c) if (mask>>j&1) mk[j+1][++tot[j+1]]=mask;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(kk,1,tot[a[i]]+1) mask=mk[a[i]][kk],u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t*c,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) now=1ll*now*(P[cnt[k]]-1)%_p;
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        num[i][j]=now=1ll*inv[cnt[a[j]]]*now%_p;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) {
    	ll tmp=0;
    	rep(j,0,i-c+1) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;
const ll oo=1e15;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+3); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) {
    	ll tmp=0;
    	rep(j,0,i) {
    		tmp+=1ll*dp[t-1][j]*num[j+1][i];
    		if (tmp>=oo) tmp%=_p;
		}
    	dp[t][i]=tmp%_p;
	}
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]];
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,1,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
//    debug_arr2(dp,5,6);
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=11;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][N],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { mem(cnt,0); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            num[i][j]=mul(now,inv[cnt[a[j]]]);
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t,n+1) rep(j,0,i) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) Mul(u[t][mask],2),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define per(i, a, b) for(int i=(b)-1; i>=(a); i--)
#define sz(a) (int)a.size()
#define de(a) cout << #a << " = " << a << endl
#define dd(a) cout << #a << " = " << a << " "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef double db;

#define mem(a,x) memset(a,x,sizeof(a))

#define rep_it(it,x) for (__typeof((x).begin()) it=(x).begin(); it!=(x).end(); it++)
#define ____ puts("\n_______________\n\n")
#define debug(x) ____; cout<< #x << " => " << (x) << endl
#define debug_pair(x) cout<<"\n{ "<<(x).fir<<" , "<<(x).sec<<" }\n"
#define debug_arr(x,n) ____; cout<<#x<<":\n"; rep(i,0,n+1) cout<<#x<<"["<<(i)<<"] => "<<x[i]<<endl
#define debug_arr2(x,n,m) ____; cout<<#x<<":\n"; rep(i,0,n+1) rep(j,0,m+1) cout<<#x<<"["<<(i)<<"]["<<(j)<<"]= "<<x[i][j]<<((j==m)?"\n\n":"    ")
#define debug_set(x) ____; cout<<#x<<": \n"; rep_it(it,x) cout<<(*it)<<" "; cout<<endl
#define debug_map(x) ____; cout<<#x<<": \n"; rep_it(it,x) debug_pair(*it)

void file_put() {
    freopen("filename.in", "r", stdin);
    freopen("filename.out", "w", stdout);
}

const int N=3005,_p=998244353,B=12;

inline int add(int x,int y) { return (x+=y)>=_p?x-_p:x; }
inline int mul(int x,int y) { return (ll)x*y%_p; }
inline void Add(int &x,int y) { (x+=y)>=_p?x-=_p:x; }
inline void Mul(int &x,int y) { x=(ll)x*y%_p; }
int Pow(int x,int k) {
    int ret=1;
    for (; k; k>>=1,Mul(x,x)) if (k&1) Mul(ret,x);
    return ret;
}

int n,c,f[N],dp[N][N],a[N],num[N][N],cnt[N],u[N][4100],P[N],inv[N],K,S;

inline void work_1() {
    rep(i,1,n+1) for (int j=i-1,now=0,tot=0; j<=n; j++) {
        if (j==i-1) { memset(cnt,0,sizeof(int)*c+1); continue; }
        tot+=!cnt[a[j]],cnt[a[j]]++;
        if (tot>=c && !now) {
            now=1;
            rep(k,1,c+1) Mul(now,P[cnt[k]]-1);
            //num[i][j]=mul(now,inv[cnt[a[j]]]);
            num[i][j]=now;
            continue;
        }
        if (tot<c) continue; else cnt[a[j]]--;
        Mul(now,inv[cnt[a[j]]]),num[i][j]=now;
        Mul(now,P[++cnt[a[j]]]-1);
    }
    dp[0][0]=1;
    rep(t,1,K+1) rep(i,t*c,n+1) rep(j,0,i-c+1) Add(dp[t][i],mul(dp[t-1][j],num[j+1][i]));
}

inline void work_2() {
    u[0][0]=dp[0][0]=1,S=(1<<c)-1;
    rep(i,1,n+1) {
        rep(t,1,K+1) dp[t][i]=u[t-1][S^(1<<a[i]-1)];
        per(t,0,K+1) {
            per(mask,1,S+1) if (mask>>(a[i]-1)&1) u[t][mask]=add(u[t][mask],u[t][mask]),Add(u[t][mask],u[t][mask^(1<<(a[i]-1))]);
            Add(u[t][0],dp[t][i]);
        }
    }
}

int main() {
    //file_put();

    scanf("%d%d",&n,&c),P[0]=inv[0]=1,K=n/c;
    rep(i,1,n+1) scanf("%d",&a[i]),P[i]=mul(P[i-1],2),inv[i]=Pow(P[i]-1,_p-2);
    if (c<=B) work_2(); else work_1();
    f[0]=P[n]-1;
    rep(t,1,n+1) rep(i,t,n+1) Add(f[t],mul(dp[t][i],P[n-i]));
    rep(t,0,n+1) printf("%d ",(f[t]-f[t+1]+_p)%_p);
    printf("\n");

	return 0;
}


//Be Name Khoda, Besmellah Rahmane Rahim, In The Name Of God;
//soal ba code ashghal va ideye roo mokh
//#include<bits/stdc++.h>
#include<iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include<bitset>
#include<list>
#include<cassert>
#include<numeric>
#include <stdio.h>
#include <string.h>
#include<iomanip>
#include<unordered_map>
#include<unordered_set>
#include <fstream>

using namespace std;

const int N = 3e3 + 20;
const int C = 10;
const int M = (1 << C) + 20;
const int mod = 998244353;

int ans[N];
int dp[N][N];
int pd[2][N][M];
int cnt[N];
int pw[N];
int a[N] , inv[N];
int n, c;

inline void add(int &a)
{
    if (a >= mod)
    {
        a -= mod;
    }
    else
    {
        if (a < 0)
        {
            a += mod;
        }
    }
}

int power(int a, int b)
{
    if (!b)
    {
        return 1;
    }
    int x = power(a, b / 2);
    x = 1LL * x * x % mod;
    if (b & 1)
    {
        x = 1LL * x * a % mod;
    }
    return x;
}

void pre()
{
    pw[0] = 0;
    for(int i = 1; i < N; i++)
    {
        pw[i] = 1LL * (pw[i - 1] + 1) * 2 % mod;
        add(pw[i] -= 1);
        inv[i] = 1LL * pw[i] * power(pw[i - 1] , mod - 2) % mod;
    }
}

void input()
{
    cin >> n >> c;
    for (int i = 1; i <= n; i++)
    {
        cin >> a[i];
        a[i]--;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    pre();
    input();
    if (c <= C)
    {
        pd[0][0][0] = 1;
        // checked;
        for (int i = 0; i < n; i++)
        {
            int x = (i & 1);
            for (int j = 0; j <= i / c + 3; j++)
            {
                for (int mask = 0; mask < (1 << c); mask++)
                {
                    pd[x ^ 1][j][mask] = 0;
                }
            }
            for (int j = 0; j <= i / c; j++)
            {
                for (int mask = 0; mask < (1 << c) - 1; mask++)
                {
                    add(pd[x ^ 1][j][mask | (1 << a[i + 1])] += pd[x][j][mask]);
                    add(pd[x ^ 1][j][mask] += pd[x][j][mask]);
                }
                add(pd[x ^ 1][j + 1][0] += pd[x ^ 1][j][(1 << c) - 1]);
                //cout << x ^ 1 << " " << j + 1 << endl;
            }
        }

        for (int j = 0; j <= n; j++)
        {
            int s = 0;
            for (int mask = 0; mask < (1 << c) - 1; mask++)
            {
                add(s += pd[n & 1][j][mask]);
            }
            if (!j)
            {
                add(s -= 1);
            }
            cout << s << " ";
        }
        cout << endl;
        return 0;
    }

    dp[0][0] = 1;
    for (int i = 1; i <= n; i++)
    {
        memset(cnt , 0 , sizeof cnt);
        int tmp = c - 1;
        int tmp2 = 1;
        for (int k = i - 1; k >= 0; k--)
        {
            int x = a[k + 1];
            if (x != a[i])
            {
                cnt[x]++;
                if (cnt[x] == 1)
                {
                    tmp--;
                }
                else
                {
                    tmp2 = 1LL * tmp2 * inv[cnt[x]] % mod;
                }
            }
            if (!tmp)
            {
                for (int j = 1; j <= k / c + 1; j++)
                {
                    dp[i][j] = (dp[i][j] + 1LL * dp[k][j - 1] * tmp2) % mod;
                }
            }
        }
    }

    for (int i = 0; i <= n; i++)
    {
        memset(cnt , 0 , sizeof cnt);
        for(int k = i + 1; k <= n; k++)
        {
            cnt[a[k]]++;
        }
        int all = pw[n - i];
        add(all += 1);
        int tmp = 1;
        for(int i = 0; i < c; i++)
        {
            tmp = 1LL * tmp * pw[cnt[i]] % mod;
        }
        add(all -= tmp);
        for(int j = 0; j <= i / c; j++)
        {
            add(ans[j] += 1LL * dp[i][j] * all % mod);
        }
    }
    add(ans[0] -= 1);
    for(int i = 0; i <= n; i++)
    {
        cout << ans[i] << " ";
    }
    cout << endl;
}


#include <cstdio>
using namespace std;

#define gc() (pt0==pt1&&(pt1=(pt0=buf)+\
	fread(buf,1,1048576,stdin),pt0==pt1)?EOF:*pt0++)
typedef long long ll;
const int jly=998244353;
int n,c,a[3005],f[3005][3005],s[3005][3005];
int qow[3005],inv[3005],ans[3005];
char buf[1048576];

inline int read() {
	static char *pt0,*pt1;
	int r=0; char c=gc(); while (c<48||c>57) c=gc();
    while (c>47&&c<58) {r=(r*10)+(c^48); c=gc();}
	return r;
}

inline int mjly(int x) {return x<jly?x:x-jly;}

inline int ksm(int u,int v) {
	int r=1; while (v) {
		if (v&1) r=(ll)u*r%jly;
		u=(ll)u*u%jly; v>>=1;
	}
	return r;
}

inline void jlytxdy() {
	int m=(1<<c)-1,ans; f[0][0]=1;
	for (int i=1;i<=n;++i) for (int j=i/c;j>=0;--j) for (int k=m;k>=0;--k) {
		if (m==(k|(1<<(a[i]-1)))) f[j+1][0]=mjly(f[j+1][0]+f[j][k]);
		else f[j][k|(1<<(a[i]-1))]=mjly(f[j][k|(1<<(a[i]-1))]+f[j][k]);
	}
	for (int i=0;i<=n;++i) {
		ans=i?0:jly-1;
		for (int j=0;j<m;++j) ans=mjly(ans+f[i][j]);
		printf("%d ",ans);
	}
}

inline void jlyakioi() {
	int exi,tmp,prd,cnt; f[0][0]=qow[0]=inv[0]=1;
	for (int i=1;i<=n;++i) {
		inv[i]=ksm((qow[i]=mjly(qow[i-1]<<1))-1,jly-2); qow[i-1]-=1;
		for (int j=1;j<=c;++j) s[i][j]=s[i-1][j]; ++s[i][a[i]];
	}
	qow[0]=0; qow[n]-=1; for (int i=0;i<=n;++i) {
		tmp=1; prd=qow[n-i]+1; exi=0;
		for (int j=i+1;j<=n;++j) {
			cnt=s[j][a[j]]-s[i][a[j]];
			tmp=(ll)tmp*(qow[cnt])%jly*inv[cnt-1]%jly;
			if (cnt==1) ++exi; if (c==exi) {
				prd=(prd+(ll)(jly-(tmp=(ll)tmp*inv[cnt]%jly))*(qow[n-j]+1))%jly;
				for (int k=i/c+1;k;--k) f[j][k]=(f[j][k]+(ll)f[i][k-1]*tmp)%jly;
				tmp=(ll)tmp*qow[cnt]%jly;
			}
		}
		for (int j=i/c;j>=0;--j) ans[j]=(ans[j]+(ll)f[i][j]*prd)%jly;
	}
	ans[0]=ans[0]?ans[0]-1:jly-1;
	for (int i=0;i<=n;++i) printf("%d ",ans[i]);
}

int main() {
	n=read(); c=read();
	for (int i=1;i<=n;++i) a[i]=read();
	if (c<11) jlytxdy(); else jlyakioi();
	return 0;
}


#include <cstdio>
using namespace std;

//#define gc() (pt0==pt1&&(pt1=(pt0=buf)+\
	fread(buf,1,1048576,stdin),pt0==pt1)?EOF:*pt0++)
#define gc() getchar()
typedef long long ll;
const int jly=998244353;
int n,c,a[3005];

inline int read() {
//	static char buf[1048576],*pt0,*pt1;
	int r=0; char c=gc(); while (c<48||c>57) c=gc();
    while (c>47&&c<58) {r=(r*10)+(c^48); c=gc();}
	return r;
}

inline int mjly(int x) {return x<jly?x:x-jly;}

inline int ksm(int u,int v) {
	int r=1; while (v) {
		if (v&1) r=(ll)u*r%jly;
		u=(ll)u*u%jly; v>>=1;
	}
	return r;
}

inline void jlytxdy() {
	static int f[3005][3005]; int m=(1<<c)-1,ans; f[0][0]=1;
	for (int i=1;i<=n;++i) for (int j=i/c;j>=0;--j) for (int k=m;k>=0;--k) {
		if (m==(k|(1<<(a[i]-1)))) f[j+1][0]=mjly(f[j+1][0]+f[j][k]);
		else f[j][k|(1<<(a[i]-1))]=mjly(f[j][k|(1<<(a[i]-1))]+f[j][k]);
	}
	for (int i=0;i<=n;++i) {
		ans=i?0:jly-1;
		for (int j=0;j<m;++j) ans=mjly(ans+f[i][j]);
		printf("%d ",ans);
	}
}

inline void jlyakioi() {
	static int f[3005][3005],s[3005][3005];
	static int qow[3005],inv[3005],ans[3005];
	int exi,tmp,prd,cnt; f[0][0]=qow[0]=inv[0]=1;
	for (int i=1;i<=n;++i) {
		inv[i]=ksm((qow[i]=mjly(qow[i-1]<<1))-1,jly-2); qow[i-1]-=1;
		for (int j=1;j<=c;++j) s[i][j]=s[i-1][j]; ++s[i][a[i]];
	}
	qow[0]=0; qow[n]-=1; for (int i=0;i<=n;++i) {
		tmp=1; prd=qow[n-i]+1; exi=0;
		for (int j=i+1;j<=n;++j) {
			cnt=s[j][a[j]]-s[i][a[j]];
			tmp=(ll)tmp*(qow[cnt])%jly*inv[cnt-1]%jly;
			if (cnt==1) ++exi; if (c==exi) {
				prd=(prd+(ll)(jly-(tmp=(ll)tmp*inv[cnt]%jly))*(qow[n-j]+1))%jly;
				for (int k=i/c+1;k;--k) f[j][k]=(f[j][k]+(ll)f[i][k-1]*tmp)%jly;
				tmp=(ll)tmp*qow[cnt]%jly;
			}
		}
		for (int j=i/c;j>=0;--j) ans[j]=(ans[j]+(ll)f[i][j]*prd)%jly;
	}
	ans[0]=ans[0]?ans[0]-1:jly-1;
	for (int i=0;i<=n;++i) printf("%d ",ans[i]);
}

int main() {
	n=read(); c=read();
	for (int i=1;i<=n;++i) a[i]=read();
	if (c<11) jlytxdy(); else jlyakioi();
	return 0;
}


#include <cstdio>
using namespace std;

#define gc() (pt0==pt1&&(pt1=(pt0=buf)+\
	fread(buf,1,1048576,stdin),pt0==pt1)?EOF:*pt0++)
typedef long long ll;
const int jly=998244353;
int n,c,a[3005];

inline int read() {
	static char buf[1048576],*pt0,*pt1;
	int r=0; char c=gc(); while (c<48||c>57) c=gc();
    while (c>47&&c<58) {r=(r*10)+(c^48); c=gc();}
	return r;
}

inline int mjly(int x) {return x<jly?x:x-jly;}

inline int ksm(int u,int v) {
	int r=1; while (v) {
		if (v&1) r=(ll)u*r%jly;
		u=(ll)u*u%jly; v>>=1;
	}
	return r;
}

inline void jlytxdy() {
	static int f[3005][3005]; int m=(1<<c)-1,ans; f[0][0]=1;
	for (int i=1;i<=n;++i) for (int j=i/c;j>=0;--j) for (int k=m;k>=0;--k) {
		if (m==(k|(1<<(a[i]-1)))) f[j+1][0]=mjly(f[j+1][0]+f[j][k]);
		else f[j][k|(1<<(a[i]-1))]=mjly(f[j][k|(1<<(a[i]-1))]+f[j][k]);
	}
	for (int i=0;i<=n;++i) {
		ans=i?0:jly-1;
		for (int j=0;j<m;++j) ans=mjly(ans+f[i][j]);
		printf("%d ",ans);
	}
}

inline void jlyakioi() {
	static int f[3005][3005],s[3005][3005];
	static int qow[3005],inv[3005],ans[3005];
	int exi,tmp,prd,cnt; f[0][0]=qow[0]=inv[0]=1;
	for (int i=1;i<=n;++i) {
		inv[i]=ksm((qow[i]=mjly(qow[i-1]<<1))-1,jly-2); qow[i-1]-=1;
		for (int j=1;j<=c;++j) s[i][j]=s[i-1][j]; ++s[i][a[i]];
	}
	qow[0]=0; qow[n]-=1; for (int i=0;i<=n;++i) {
		tmp=1; prd=qow[n-i]+1; exi=0;
		for (int j=i+1;j<=n;++j) {
			cnt=s[j][a[j]]-s[i][a[j]];
			tmp=(ll)tmp*(qow[cnt])%jly*inv[cnt-1]%jly;
			if (cnt==1) ++exi; if (c==exi) {
				prd=(prd+(ll)(jly-(tmp=(ll)tmp*inv[cnt]%jly))*(qow[n-j]+1))%jly;
				for (int k=i/c+1;k;--k) f[j][k]=(f[j][k]+(ll)f[i][k-1]*tmp)%jly;
				tmp=(ll)tmp*qow[cnt]%jly;
			}
		}
		for (int j=i/c;j>=0;--j) ans[j]=(ans[j]+(ll)f[i][j]*prd)%jly;
	}
	ans[0]=ans[0]?ans[0]-1:jly-1;
	for (int i=0;i<=n;++i) printf("%d ",ans[i]);
}

int main() {
	n=read(); c=read();
	for (int i=1;i<=n;++i) a[i]=read();
	if (c<11) jlytxdy(); else jlyakioi();
	return 0;
}


#include <cstdio>
#include <cstring>
using namespace std;

#define gc() (pt0==pt1&&(pt1=(pt0=buf)+\
	fread(buf,1,1048576,stdin),pt0==pt1)?EOF:*pt0++)
typedef long long ll;
const int jly=998244353;
int n,c,a[3005];

inline int read() {
	static char buf[1048576],*pt0,*pt1;
	int r=0; char c=gc(); while (c<48||c>57) c=gc();
    while (c>47&&c<58) {r=(r*10)+(c^48); c=gc();}
	return r;
}

inline int mjly(int x) {return x<jly?x:x-jly;}

inline int ksm(int u,int v) {
	int r=1; while (v) {
		if (v&1) r=(ll)u*r%jly;
		u=(ll)u*u%jly; v>>=1;
	}
	return r;
}

inline void jlytxdy() {
	static int f[3005][3005]; int m=(1<<c)-1,ans; f[0][0]=1;
	for (int i=1;i<=n;++i) for (int j=i/c;j>=0;--j) for (int k=m;k>=0;--k) {
		if (m==(k|(1<<(a[i]-1)))) f[j+1][0]=mjly(f[j+1][0]+f[j][k]);
		else f[j][k|(1<<(a[i]-1))]=mjly(f[j][k|(1<<(a[i]-1))]+f[j][k]);
	}
	for (int i=0;i<=n;++i) {
		ans=i?0:jly-1;
		for (int j=0;j<m;++j) ans=mjly(ans+f[i][j]);
		printf("%d ",ans);
	}
}

inline void jlyakioi() {
	static int f[3005][3005],s[3005][3005];
	static int qow[3005],inv[3005],ans[3005];
	int exi,tmp,prd,cnt; f[0][0]=qow[0]=inv[0]=1;
	for (int i=1;i<=n;++i) {
		inv[i]=ksm((qow[i]=mjly(qow[i-1]<<1))-1,jly-2); qow[i-1]-=1;
		for (int j=1;j<=c;++j) s[i][j]=s[i-1][j]; ++s[i][a[i]];
	}
	qow[0]=0; qow[n]-=1; for (int i=0;i<=n;++i) {
		tmp=1; prd=qow[n-i]+1; exi=0;
		for (int j=i+1;j<=n;++j) {
			cnt=s[j][a[j]]-s[i][a[j]];
			tmp=(ll)tmp*(qow[cnt])%jly*inv[cnt-1]%jly;
			if (cnt==1) ++exi; if (c==exi) {
				prd=(prd+(ll)(jly-(tmp=(ll)tmp*inv[cnt]%jly))*(qow[n-j]+1))%jly;
				for (int k=i/c+1;k;--k) f[j][k]=(f[j][k]+(ll)f[i][k-1]*tmp)%jly;
				tmp=(ll)tmp*qow[cnt]%jly;
			}
		}
		for (int j=i/c;j>=0;--j) ans[j]=(ans[j]+(ll)f[i][j]*prd)%jly;
	}
	ans[0]=ans[0]?ans[0]-1:jly-1;
	for (int i=0;i<=n;++i) printf("%d ",ans[i]);
}

int main() {
	n=read(); c=read();
	for (int i=1;i<=n;++i) a[i]=read();
	if (c<11) jlytxdy(); else jlyakioi();
	return 0;
}


#pragma gcc optimize(s)
#pragma g++ optimize(s)
#include <cstdio>
#include <cstring>
using namespace std;

#define gc() (pt0==pt1&&(pt1=(pt0=buf)+\
	fread(buf,1,1048576,stdin),pt0==pt1)?EOF:*pt0++)
typedef long long ll;
const int jly=998244353;
int n,c,a[3005];

inline int read() {
	static char buf[1048576],*pt0,*pt1;
	int r=0; char c=gc(); while (c<48||c>57) c=gc();
    while (c>47&&c<58) {r=(r*10)+(c^48); c=gc();}
	return r;
}

inline int mjly(int x) {return x<jly?x:x-jly;}

inline int ksm(int u,int v) {
	int r=1; while (v) {
		if (v&1) r=(ll)u*r%jly;
		u=(ll)u*u%jly; v>>=1;
	}
	return r;
}

inline void jlytxdy() {
	static int f[3005][3005]; int m=(1<<c)-1,ans; f[0][0]=1;
	for (int i=1;i<=n;++i) for (int j=i/c;j>=0;--j) for (int k=m;k>=0;--k) {
		if (m==(k|(1<<(a[i]-1)))) f[j+1][0]=mjly(f[j+1][0]+f[j][k]);
		else f[j][k|(1<<(a[i]-1))]=mjly(f[j][k|(1<<(a[i]-1))]+f[j][k]);
	}
	for (int i=0;i<=n;++i) {
		ans=i?0:jly-1;
		for (int j=0;j<m;++j) ans=mjly(ans+f[i][j]);
		printf("%d ",ans);
	}
}

inline void jlyakioi() {
	static int f[3005][3005],s[3005][3005];
	static int qow[3005],inv[3005],ans[3005];
	int exi,tmp,prd,cnt; f[0][0]=qow[0]=inv[0]=1;
	for (int i=1;i<=n;++i) {
		inv[i]=ksm((qow[i]=mjly(qow[i-1]<<1))-1,jly-2); qow[i-1]-=1;
		for (int j=1;j<=c;++j) s[i][j]=s[i-1][j]; ++s[i][a[i]];
	}
	qow[0]=0; qow[n]-=1; for (int i=0;i<=n;++i) {
		tmp=1; prd=qow[n-i]+1; exi=0;
		for (int j=i+1;j<=n;++j) {
			cnt=s[j][a[j]]-s[i][a[j]];
			tmp=(ll)tmp*(qow[cnt])%jly*inv[cnt-1]%jly;
			if (cnt==1) ++exi; if (c==exi) {
				prd=(prd+(ll)(jly-(tmp=(ll)tmp*inv[cnt]%jly))*(qow[n-j]+1))%jly;
				for (int k=i/c+1;k;--k) f[j][k]=(f[j][k]+(ll)f[i][k-1]*tmp)%jly;
				tmp=(ll)tmp*qow[cnt]%jly;
			}
		}
		for (int j=i/c;j>=0;--j) ans[j]=(ans[j]+(ll)f[i][j]*prd)%jly;
	}
	ans[0]=ans[0]?ans[0]-1:jly-1;
	for (int i=0;i<=n;++i) printf("%d ",ans[i]);
}

int main() {
	n=read(); c=read();
	for (int i=1;i<=n;++i) a[i]=read();
	if (c<11) jlytxdy(); else jlyakioi();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

const int N = 3e3 + 5;

#define ll long long

void exgcd(int a, int b, int& x, int& y) {
	if (!b) {
		x = 1, y = 0;
	} else {
		exgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
}

int inv(int a, int n) {
	int x, y;
	exgcd(a, n, x, y);
	return (x < 0) ? (x + n) : (x);
}

const int Mod = 998244353;

template <const int Mod = :: Mod>
class Z {
	public:
		int v;

		Z() : v(0) {	}
		Z(int x) : v(x){	}
		Z(ll x) : v(x % Mod) {	}

		Z operator + (Z b) {
			int x;
			return Z(((x = v + b.v) >= Mod) ? (x - Mod) : (x));
		}
		Z operator - (Z b) {
			int x;
			return Z(((x = v - b.v) < 0) ? (x + Mod) : (x));
		}
		Z operator * (Z b) {
			return Z(v * 1ll * b.v);
		}
		Z operator ~() {
			return inv(v, Mod);
		}
		Z operator - () {
			return Z(0) - *this;
		}
		Z& operator += (Z b) {
			return *this = *this + b;
		}
		Z& operator -= (Z b) {
			return *this = *this - b;
		}
		Z& operator *= (Z b) {
			return *this = *this * b;
		}
};

Z<> qpow(Z<> a, int p) {
	Z<> rt = Z<>(1), pa = a;
	for ( ; p; p >>= 1, pa = pa * pa) {
		if (p & 1) {
			rt = rt * pa;
		}
	}
	return rt;
}

typedef Z<> Zi;

int n, m, C;
Zi ans[N];
int a[N], c[N];
Zi g[N][N], h[N];
Zi pw2[N], spw2[N], _spw2[N];

void dp1() {
	static Zi f[N][N];
	spw2[0] = 0, pw2[0] = 1;
	for (int i = 1; i <= n; i++)
		pw2[i] = pw2[i - 1] + pw2[i - 1];
	for (int i = 1; i <= n; i++)
		spw2[i] = spw2[i - 1] + spw2[i - 1] + 1;
	for (int i = 1; i <= n; i++)
		_spw2[i] = ~spw2[i];
	for (int l = 1; l <= n; l++) {
		memset(c, 0, (C + 1) << 2);
		int cnt = 0;
		Zi v = 1;
		for (int r = l; r <= n; r++) {
			int& cr = c[a[r]];
			if (!c[a[r]]) {
				cnt++, cr = 1;
			} else {
				cr++;
				v = v * _spw2[cr - 1] * spw2[cr];
			}
			if (cnt == C && a[l] != a[r]) {
				g[l][r] = v * _spw2[c[a[l]]] * pw2[c[a[l]] - 1] * _spw2[cr];
			} else if (cnt == C && l == r) {
				g[l][r] = 1;
			}
		}
		v = v * (cnt == C);
		h[l] = pw2[n - l + 1] - v;
	}
	/* for (int l = 1; l <= n; l++, cerr << '\n') {
		for (int r = 1; r <= n; r++) {
			cerr << g[l][r].v << ' ';
		}
	} */
	h[n + 1] = 1;
	/* for (int i = 1; i <= n; i++) {
		cerr << i << " " << h[i].v << '\n';
	} */
	for (int r = 1; r <= n; r++) {
		for (int l = 1; l <= r; l++) {
			g[l][r] += g[l - 1][r];
		}
	}
	f[0][0] = 1;
	for (int i = 0; i <= m; i++) {
		for (int j = 0; j <= n; j++) {
			Zi v = f[i][j];
			if (!v.v) {
				continue;
			}
			for (int r = j + 1; r <= n; r++) {
				f[i + 1][r] += v * (g[r][r] - g[j][r]);
			}
			ans[i] += v * h[j + 1];
		}
	}
}

void dp2() {
	int M = (m + 1) * (1 << C), S = (1 << C) - 1;
	Zi *fcur = new Zi[M];
	Zi *fnxt = new Zi[M];
	for (int i = 1; i <= n; i++) {
		a[i]--;
	}
	memset(fcur, 0, M << 2);
	fcur[0] = 1;
	for (int i = 1; i <= n; i++) {
		memset(fnxt, 0, M << 2);
		for (int j = 0; j < m; j++) {
			for (int s = 0; s < S; s++) {
				Zi v = fcur[j << C | s];
				if (v.v) {
					fnxt[j << C | s] += v;
					if ((s | (1 << a[i])) < S) {
						fnxt[j << C | (s | (1 << a[i]))] += v;
					} else {
						fnxt[(j + 1) << C] += v;
					}
				}
			}
		}
		swap(fcur, fnxt);
	}
	for (int i = 0; i < M; i++) {
		ans[i >> C] += fcur[i];
	}
}

int main() {
	scanf("%d%d", &n, &C);
	m = n / C;
	for (int i = 1; i <= n; i++) {
		scanf("%d", a + i);
	}
	if (C <= 20 && (1 << C) <= n) {
		dp2();
	} else {
		dp1();
	}
	ans[0] -= 1;
	for (int i = 0; i <= n; i++) {
		printf("%d ", ans[i].v);
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
typedef bool boolean;

const int N = 3e3 + 5;

#define ll long long

void exgcd(int a, int b, int& x, int& y) {
	if (!b) {
		x = 1, y = 0;
	} else {
		exgcd(b, a % b, y, x);
		y -= (a / b) * x;
	}
}

int inv(int a, int n) {
	int x, y;
	exgcd(a, n, x, y);
	return (x < 0) ? (x + n) : (x);
}

const int Mod = 998244353;

template <const int Mod = :: Mod>
class Z {
	public:
		int v;

		Z() : v(0) {	}
		Z(int x) : v(x){	}
		Z(ll x) : v(x % Mod) {	}

		Z operator + (Z b) {
			int x;
			return Z(((x = v + b.v) >= Mod) ? (x - Mod) : (x));
		}
		Z operator - (Z b) {
			int x;
			return Z(((x = v - b.v) < 0) ? (x + Mod) : (x));
		}
		Z operator * (Z b) {
			return Z(v * 1ll * b.v);
		}
		Z operator ~() {
			return inv(v, Mod);
		}
		Z operator - () {
			return Z(0) - *this;
		}
		Z& operator += (Z b) {
			return *this = *this + b;
		}
		Z& operator -= (Z b) {
			return *this = *this - b;
		}
		Z& operator *= (Z b) {
			return *this = *this * b;
		}
};

Z<> qpow(Z<> a, int p) {
	Z<> rt = Z<>(1), pa = a;
	for ( ; p; p >>= 1, pa = pa * pa) {
		if (p & 1) {
			rt = rt * pa;
		}
	}
	return rt;
}

typedef Z<> Zi;

int n, m, C;
Zi ans[N];
int a[N], c[N];
Zi g[N][N], h[N];
Zi pw2[N], spw2[N], _spw2[N];

void dp1() {
	static Zi f[N][N];
	spw2[0] = 0, pw2[0] = 1;
	for (int i = 1; i <= n; i++)
		pw2[i] = pw2[i - 1] + pw2[i - 1];
	for (int i = 1; i <= n; i++)
		spw2[i] = spw2[i - 1] + spw2[i - 1] + 1;
	for (int i = 1; i <= n; i++)
		_spw2[i] = ~spw2[i];
	for (int l = 1; l <= n; l++) {
		memset(c, 0, (C + 1) << 2);
		int cnt = 0;
		Zi v = 1;
		for (int r = l; r <= n; r++) {
			int& cr = c[a[r]];
			if (!c[a[r]]) {
				cnt++, cr = 1;
			} else {
				cr++;
				v = v * _spw2[cr - 1] * spw2[cr];
			}
			if (cnt == C && a[l] != a[r]) {
				g[l][r] = v * _spw2[c[a[l]]] * pw2[c[a[l]] - 1] * _spw2[cr];
			} else if (cnt == C && l == r) {
				g[l][r] = 1;
			}
		}
		v = v * (cnt == C);
		h[l] = pw2[n - l + 1] - v;
	}
	/* for (int l = 1; l <= n; l++, cerr << '\n') {
		for (int r = 1; r <= n; r++) {
			cerr << g[l][r].v << ' ';
		}
	} */
	h[n + 1] = 1;
	/* for (int i = 1; i <= n; i++) {
		cerr << i << " " << h[i].v << '\n';
	} */
	for (int r = 1; r <= n; r++) {
		for (int l = 1; l <= r; l++) {
			g[l][r] += g[l - 1][r];
		}
	}
	f[0][0] = 1;
	for (int i = 0; i <= m; i++) {
		for (int j = 0; j <= n; j++) {
			Zi v = f[i][j];
			if (!v.v) {
				continue;
			}
			for (int r = j + 1; r <= n; r++) {
				f[i + 1][r] += v * (g[r][r] - g[j][r]);
			}
			ans[i] += v * h[j + 1];
		}
	}
}

void dp2() {
	int M = (m + 1) * (1 << C), S = (1 << C) - 1;
	Zi *fcur = new Zi[M];
	Zi *fnxt = new Zi[M];
	for (int i = 1; i <= n; i++) {
		a[i]--;
	}
	memset(fcur, 0, M << 2);
	fcur[0] = 1;
	for (int i = 1; i <= n; i++) {
		memset(fnxt, 0, M << 2);
		for (int j = 0; j <= m; j++) {
			for (int s = 0; s < S; s++) {
				Zi v = fcur[j << C | s];
				if (v.v) {
					fnxt[j << C | s] += v;
					if ((s | (1 << a[i])) < S) {
						fnxt[j << C | (s | (1 << a[i]))] += v;
					} else if (j < m) {
						fnxt[(j + 1) << C] += v;
					}
				}
			}
		}
		swap(fcur, fnxt);
	}
	for (int i = 0; i < M; i++) {
		ans[i >> C] += fcur[i];
	}
}

int main() {
	scanf("%d%d", &n, &C);
	m = n / C;
	for (int i = 1; i <= n; i++) {
		scanf("%d", a + i);
	}
	if (C <= 20 && (1 << C) <= n) {
		dp2();
	} else {
		dp1();
	}
	ans[0] -= 1;
	for (int i = 0; i <= n; i++) {
		printf("%d ", ans[i].v);
	}
	return 0;
}