#include <algorithm>  
#include <iostream>  
#include <sstream>  
#include <string>  
#include <vector>  
#include <queue>  
#include <set>  
#include <map>  
#include <cstdio>  
#include <cstdlib>  
#include <cctype>  
#include <cmath>  
#include <cstring>
#include <list>  
#include <cassert>
#include <climits>
#include <bitset>
#include <chrono>
#include <random>
using namespace std;

#define PB push_back  
#define MP make_pair  
#define SZ(v) ((int)(v).size())  
#define FOR(i,a,b) for(int i=(a);i<(b);++i)  
#define REP(i,n) FOR(i,0,n)  
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)  
#define REPE(i,n) FORE(i,0,n)  
#define FORSZ(i,a,v) FOR(i,a,SZ(v))  
#define REPSZ(i,v) REP(i,SZ(v))  
std::mt19937 rnd((int)std::chrono::steady_clock::now().time_since_epoch().count());
typedef long long ll;
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }

const int MAXN = 200000;
const int MOD = 998244353;
const int MAXPW = 300;
const int INV2 = (MOD + 1) / 2;
void inc(int& a, int b) { if ((a += b) >= MOD) a -= MOD; }

int n, mxpw;
int a[MAXN];
int ans[MAXPW + 1];

int sum[MAXPW + 1];
int choose[MAXPW + 1][MAXPW + 1];

void solve() {
	REPE(i, mxpw) { choose[i][0] = choose[i][i] = 1; FOR(j, 1, i) choose[i][j] = (choose[i - 1][j - 1] + choose[i - 1][j]) % MOD; }

	REPE(i, mxpw) sum[i] = 0;
	REP(i, n) {
		int x = 1;
		inc(sum[0], x);
		FORE(j, 1, mxpw) { x = (ll)x * a[i] % MOD; inc(sum[j], x); }
	}
	//printf("sum:"); REPE(i, mxpw) printf(" %d", sum[i]); puts("");

	FORE(x, 1, mxpw) {
		ans[x] = 0;
		REPE(i, x) {
			int num = ((ll)sum[i] * sum[x - i] - sum[x]) % MOD;
			//printf("(%d,%d) -> %d*%d/2\n", i, x, choose[x][i], num);
			ans[x] = (ans[x] + (ll)choose[x][i] * num % MOD * INV2) % MOD;
		}
	}
}

void run() {
	scanf("%d%d", &n, &mxpw);
	REP(i, n) scanf("%d", &a[i]);
	solve();
	FORE(i, 1, mxpw) printf("%d\n", ans[i]);
}

int main() {
	run();
	return 0;
}

#include <algorithm>
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep_e(i, n) for(int i = 0; i <= n; i++)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;

int main() {
    long long n;
    string t;
    cin >> n >> t;
    long long ans = 0;
    string s = "110";
    int count = 1;
    long long max = pow(10, 10);
    if(t == "1"){
        ans = max * 2;
    }else if(t == "0"){
        ans = max;
    }else if(t == "00"){
        ans = 0;
    }else if(t == "01"){
        ans = max - 1;
    }else if(t == "10"){
        ans = max;
    }else if(t == "11"){
        ans = max;
    }else{ // 3文字以上
        while((int)s.size() - 3 < n){
            s = s + "110";
            count++;
        }

        rep(i, (int)s.size()){
            if(s.substr(i, n) == t){
                ans++;
            }
        }
        if(ans == 0){
            ans = 0;
        }else{
            if(t[0] == '0' and t[1] == '1' and t[2] == '1' and (int)t.size() % 3 == 2){
                ans = max - (int)t.size() / 3 - 1;
            }else if(t[0] == '0' and t[1] == '1' and t[2] == '1' and (int)t.size() % 3 != 2){
                ans = max - (int)t.size() / 3;
            }else if(t[0] == '1' and t[1] == '0' and t[2] == '1'){
                ans = max - (int)t.size() / 3;
            }else if(t[0] == '1' and t[1] == '1' and t[2] == '0' and (int)t.size() % 3 == 0){
                ans = max - (int)t.size() / 3 + 1;
            }else if(t[0] == '1' and t[1] == '1' and t[2] == '0' and (int)t.size() % 3 != 0){
                ans = max - (int)t.size() / 3;
            }
        }
    }
    cout << ans << endl;
}
