// In the name of god

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace std;
using namespace __gnu_pbds; 

template < class T > using ordered_set = tree < T , null_type , less < T > , rb_tree_tag , tree_order_statistics_node_update >;
  
typedef long long                   ll;
typedef long double                 ld;
typedef pair<int,int>               pii;
typedef pair<ll,ll>                 pll;
#define all(x)                      (x).begin(),(x).end()
#define lc(x)                       (x) << 1
#define rc(x)                       (x) << 1 | 1
#define F                           first
#define S                           second
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io                     freopen("in.txt" , "r+" , stdin) ; freopen("out.txt" , "w+" , stdout);
#define mp                          make_pair
ll poww(ll a, ll b, ll md) {
    ll ans = 1;
    for(; b; b >>= 1, a = a * a % md){
        if(b & 1){
            ans = ans * a % md;
        }
    }
    return ans % md;
}

const int MAXN = 3e3 + 10;
const int MAXLG = 12;
const int MOD = 998244353;
const ll INF = 8e18;
int n, c, a[MAXN], dp[MAXN][MAXN], pd[2][MAXN][1 << MAXLG], cnt[MAXN], pw[MAXN], inv[MAXN], f[MAXN];

int main()
{
    scanf("%d %d", &n, &c);
    for(int i = 1; i <= n; i++){
        scanf("%d", a + i);
    }
    for(int i = 1; i < MAXN; i++){
        pw[i] = (1LL * 2 * pw[i - 1] + 1);
        while(pw[i] >= MOD){
            pw[i] -= MOD;
        }
    }
    for(int i = 1; i < MAXN; i++){
        inv[i] = poww(pw[i], MOD - 2, MOD);
    }
    pw[0] = inv[0] = 1;
    if(c > MAXLG){
        for(int i = 0; i < n; i++){
            dp[i][0] = poww(2, i, MOD);
            int tmp = 0, mul = 1;
            for(int j = i + 1; j <= n; j++){
                if(cnt[a[j]] == 0){
                    tmp++;
                }
                cnt[a[j]]++;
                mul = (1LL * mul * inv[cnt[a[j]] - 1]) % MOD;
                if(tmp == c){
                    for(int k = 0; k <= i / c; k++){
                        dp[j][k + 1] = (dp[j][k + 1] + 1LL * dp[i][k] * mul) % MOD;
                    }
                }
                mul = (1LL * mul * pw[cnt[a[j]]]) % MOD;
            }
            for(int j = i + 1; j <= n; j++){
                cnt[a[j]]--;
            }
        }
        for(int k = 0; k <= n / c; k++){
            for(int i = 1; i <= n; i++){
                f[k] = ((1LL * dp[i][k] * poww(2, n - i, MOD)) + f[k]) % MOD;
            }
        }
        for(int k = 0; k < n / c; k++){
            f[k] -= f[k + 1];
            if(f[k] < 0){
                f[k] += MOD;
            }
        }
        f[0]--;
        if(f[0] < 0){
            f[0] += MOD;
        }
        for(int i = 0; i <= n; i++){
            printf("%d ", f[i]);
        }
        printf("\n");
    }
    else{
        int x = (1 << c) - 1;
        for(int i = 1; i <= n; i++){
            a[i]--;
        }
        pd[0][0][0] = 1;
        for(int i = 1; i <= n; i++){
            int cur = (i & 1), pre = cur ^ 1;
            for(int j = 0; j <= i / c; j++){
                pd[cur][j][0] = pd[pre][j][0];
                if(j){
                    pd[cur][j][0] = (pd[cur][j][0] + pd[pre][j - 1][x ^ (1 << a[i])]) % MOD;
                }
                for(int mask = 1; mask < x; mask++){
                    pd[cur][j][mask] = pd[pre][j][mask];
                    if(mask & (1 << (a[i]))){
                        pd[cur][j][mask] = ((pd[cur][j][mask] + pd[pre][j][mask ^ (1 << a[i])]) % MOD + pd[pre][j][mask]) % MOD;
                    }
                }
            }
        }
        for(int i = 0; i <= n / c; i++){
            for(int j = 0; j < x; j++){
                f[i] = (f[i] + pd[n & 1][i][j]) % MOD;
            }
        }
        f[0]--;
        if(f[0] < 0){
            f[0] += MOD;
        }
        for(int i = 0; i <= n; i++){
            printf("%d ", f[i]);
        }
        printf("\n");
    }
}


