#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define FORR2(x,y,arr) for(auto& [x,y]:arr)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
template<class T> bool chmax(T &a, const T &b) { if(a<b){a=b;return 1;}return 0;}
template<class T> bool chmin(T &a, const T &b) { if(a>b){a=b;return 1;}return 0;}
//-------------------------------------------------------

int N,M;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>M;
	vector<int> A;
	A.push_back(0);
	FOR(i,M) {
		cin>>x;
		A.push_back(x);
	}
	A.push_back(N+1);
	sort(ALL(A));
	int mi=N;
	FOR(i,A.size()-1) {
		if(A[i+1]-A[i]>1) mi=min(mi,A[i+1]-A[i]-1);
	}
	
	if(M==N) return _P("0\n");
	int ret=0;
	FOR(i,A.size()-1) {
		if(A[i+1]-A[i]>1) ret+=(A[i+1]-A[i]-1+(mi-1))/mi;
	}
	cout<<ret<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)

int p=998244353;
int siz=3*1e5;
vector<ll> A(siz);
vector<ll> B(siz);

ll powk(ll k,ll n){
  ll ans=1,m=k;
  while(n){
    if(n%2) ans=ans*m%p;
    m*=m; m%=p; n/=2;
  }
  return ans;
}

void comb1(){
  A[0]=1;
  for(ll i=1;i<siz;i++) A[i]=A[i-1]*i%p;
  rep(i,siz) B[i]=powk(A[i],p-2);
  return;
}

ll comb(int n,int k){
  return A[n]*B[n-k]%p*B[k]%p;
}

int main(){
  comb1();
  int n,k;
  cin >> n >> k;
  vector<ll> a(n);
  rep(i,n) cin >> a[i];
  
  vector<ll> b(n,1);
  vector<ll> sum(k+5);
  rep(i,k+5){
    rep(j,n) sum[i]=(sum[i]+b[j])%p;
    rep(j,n) b[j]=b[j]*a[j]%p;
  }
  
  for(int x=1;x<=k;x++){
    ll ans=(n-1)*sum[x]%p;
    for(int i=1;i*2<=x;i++){
      ll y=sum[x-i]*sum[i]%p;
      y=(y+p-sum[x])%p;
      y=y*comb(x,i)%p;
      if(i*2==x) y*=B[2];
      ans=(ans+y)%p;
    }
    cout << ans << endl;
  }
}