#include<bits/stdc++.h>
using namespace std;
using ll=long long;
static const ll mod=998244353;
ll N,K;
ll power[301];
ll modpow(ll a,ll n){
ll res=1;
  while(0<n){
  if(n%2==1)res=(res*a)%mod;
    a=(a*a)%mod;
    n>>=1;
  }return res;
}
ll fac[301];
ll rev[301];
ll comb(ll n,ll k){
if(n<k)return 0;
  ll x=(fac[n]*rev[k])%mod;
  x=(x*rev[n-k])%mod;return x;
}
int main(){
  cin>>N>>K;ll rev2=modpow(2,mod-2);
  fac[0]=1;rev[0]=1;
  for(ll i=1;i<=300;i++){
  fac[i]=(i*fac[i-1])%mod;
    rev[i]=modpow(fac[i],mod-2);
  }
  vector<ll>A(N);
  for(ll i=0;i<N;i++)
    cin>>A[i];power[0]=N;
  for(ll i=0;i<N;i++){
  ll a=A[i];
    for(ll j=1;j<=300;j++){
    power[j]=(power[j]+a)%mod;
      a=(a*A[i])%mod;
      }
  }for(ll k=1;k<=K;k++){
    ll ans=0;
  for(ll i=1;i<=k/2;i++){
    ll x=(comb(k,i)*(mod-power[k]+(power[i]*power[k-i])%mod))%mod;
     ans=(ans+x)%mod;
  }
   ans=(ans+(N-1)*power[k])%mod;
 if(k%2==0){ ll x=(comb(k,k/2)*(mod-power[k]+(power[k/2]*power[k/2])%mod))%mod;
            x=(x*rev2)%mod;
     ans=(mod+ans-x)%mod;}
    cout<<ans<<endl;
  }
  return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

const ll mod = 1000000007;

int f[100000][2] = {0}, times[100000][2] = {0};

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    int n;
    cin >> n >> f[0][0];
    times[0][0] = 1;
    for (int i = 1; i < n; ++i) {
        times[i][0] = (times[i - 1][0] + times[i - 1][1]) % mod;
        times[i][1] = times[i - 1][0];
        cin >> f[i][1];
        f[i][0] = ((f[i - 1][0] + f[i - 1][1]) % mod + (ll)f[i][1] * times[i][0] % mod) % mod;
        f[i][1] = (f[i - 1][0] - (ll)f[i][1] * times[i][1]) % mod;
        if (f[i][1] < 0) f[i][1] += mod;
    }
    cout << (f[n - 1][0] + f[n - 1][1]) % mod;
}