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

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<long long> VL;
typedef vector<vector<long long>> VVL;
typedef pair<int,int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define EXIST(m,v) (m).find((v)) != (m).end()
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

constexpr double EPS = 1e-9;
constexpr double PI  = 3.1415926535897932;
constexpr int INF = 2147483647;
constexpr long long LINF = 1LL<<60;
constexpr long long MOD = 998244353;

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

struct mint {
    long long x;
    mint(long long x=0):x((x%MOD+MOD)%MOD){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
    	return *this;
    }
    mint& operator*=(const mint a) {
    	(x *= a.x) %= MOD;
    	return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
    	if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint a) {
    	return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};

void Main(){
    ll N,K; cin >> N >> K;
    VL A(N); REP(i,N) cin >> A[i];

    mint kai[K+1]; kai[0]=1; REP(i,K) kai[i+1] = kai[i]*(i+1);
    mint p[N], sum[K+1]; REP(i,N) p[i] = 1; sum[0] = N;
    REP(i,K){
        REP(j,N){
            p[j] *= A[j];
            sum[i+1] += p[j];
        }
        sum[i+1] /= kai[i+1];
    }

    mint same_pair[K+1]; same_pair[0] = N;
    REP(i,N) p[i] = 1;
    REP(i,K)REP(j,N){
        p[j] *= A[j]+A[j];
        same_pair[i+1] += p[j];
    }

    FOR(X,1,K+1){
        mint ans(0);
        REP(k,X+1) ans += sum[X-k] * sum[k];
        ans *= kai[X];
        ans = (ans - same_pair[X]) / 2;

        cout << ans.x << en;
    }
    return;
}

int main(void){
    cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(0);cout<<fixed<<setprecision(15);
    int t=1; //cin>>t;
    REP(_,t) Main();
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
using Pair = pair<int, int>;
using Queue = queue<int>;
using Graph = vector<vector<int>>;

int main()
{
    int N, M;
    cin >> N >> M;
    int M2 = M + 1;
    vector<Pair> XY(M2);
    map<Pair, int> idx_map;
    map<int, vector<int>> YX;
    XY.at(0) = {0, N};
    idx_map[{0, N}] = 0;
    YX[N].push_back(0);
    for (int i = 1; i < M2; ++i) {
        auto &[Xi, Yi] = XY.at(i);
        cin >> Xi >> Yi;
        idx_map[{Xi, Yi}] = i;
        YX[Yi].push_back(Xi);
    }
    for (auto &[Yi, X] : YX)
        sort(X.begin(), X.end());
    Graph graph(M2);
    for (int i = 0; i < M2; ++i) {
        auto [Xi, Yi] = XY.at(i);
        auto ub = 2 * N + 1;
        auto &vec1 = YX[Yi];
        auto it1 = upper_bound(vec1.begin(), vec1.end(), Xi);
        if (it1 != vec1.end())
            ub = *it1;
        int y2 = Yi - 1, y3 = Yi + 1;
        if (YX.count(y2)) {
            auto &vec2 = YX.at(y2);
            auto it2 = upper_bound(vec2.begin(), vec2.end(), Xi);
            for ( ; (it2 != vec2.end()) && (*it2 <= ub); ++it2)
                graph.at(i).push_back(idx_map.at({*it2, y2}));
        }
        if (YX.count(y3)) {
            auto &vec3 = YX.at(y3);
            auto it3 = upper_bound(vec3.begin(), vec3.end(), Xi);
            for ( ; (it3 != vec3.end()) && (*it3 <= ub); ++it3)
                graph.at(i).push_back(idx_map.at({*it3, y3}));
        }
    }
    Queue que;
    vector<bool> seen(M2, false);
    que.push(0);
    seen.at(0) = true;
    assert(idx_map.at({0, N}) == 0);
    while (!que.empty()) {
        auto u = que.front(); que.pop();
        for (auto v : graph.at(u)) {
            if (seen.at(v))
                continue;
            seen.at(v) = true;
            que.push(v);
        }
    }
    int cnt = 0;
    for (auto &[Yi, X] : YX) {
        auto idx = idx_map.at({X.back(), Yi});
        if (seen.at(idx))
            ++cnt;
    }
    cout << cnt << endl;
}
