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

const ll mx=1000000;
vector<ll> spf(mx+1);

void cspf() {
    for(ll x=2;x<=mx;x++) spf[x]=x;
    for(ll x=2;x*x<=mx;x++) {
    	
        if(spf[x]==x) {
            for(ll y=x*x;y<=mx;y+=x) {
            	
                if(spf[y]==y) spf[y]=x;
            }
        }
        
   
    }
}

unordered_map<ll,ll> cl(ll v) {
    unordered_map<ll,ll> a;
    while(v!=1) {
        ll d=spf[v];
        
        a[d]++;
        v/=d;
    
    	
    }
    return a;
}

int main() {
    ll n,m;
    cin>>n>>m;
    
    unordered_map<ll,ll> b;
    
    cspf();
    ll md=1e9+7;
    for(ll i=2;i<=m;i++) {
        unordered_map<ll,ll> a=cl(i);
        
        for(auto it=a.begin();it!=a.end();++it) {
        	b[it->first]+=it->second;
        	
        }
    }
    
    ll arr[n+1]={0};
    for(ll i=1;i<=n;i++) {
        unordered_map<ll,ll> b5=b;
        ll g=1;
        
        cin>>arr[i];
        unordered_map<ll,ll> a=cl(arr[i]);
        
        for(auto it=a.begin();it!=a.end();++it)
        {
        	
        	 b5[it->first]+=it->second;
        	 
        }
        for(auto it=b5.begin();it!=b5.end();++it) {
        	g=(g*((it->second+1)%md))%md;
        	
        }
        cout<<g<<" ";
    }
    return 0;
}
