#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
 
#define ll              long long int
#define vll             vector<ll>
#define vs              vector <string>                                    
#define mll             map<ll,ll>
#define pll             pair<ll, ll>
#define vpll            vector < pair<ll,ll> >
#define itr             vll::iterator
#define all(c)          c.begin(),c.end()
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define ps(x,y)         fixed<<setprecision(y)<<x
#define pb              push_back
#define mb              make_pair
#define ff              first
#define ss              second
#define max3(a,b,c)     max(max(a,b),c)                                    
#define min3(a,b,c)     min(min(a,b),c)  
#define mod             1000000007
#define inf             1000000000000000001
#define from(i, n)      for(__typeof(n) i = 0; i <  n; ++i)
#define fromj(i, j, n)  for(__typeof(n) i = j; i <  n; ++i)
#define printv(v)       from(i,v.size())cout<<v[i]<<" ";cout<<"\n";
#define w(x)            int x; cin>>x; while(x--)
 
using namespace std;
using namespace __gnu_pbds; 
 
void c_p_c()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif
}
 
bool func(const pll &a, const pll &b){
    if(a.ss==b.ss)return a.ff<b.ff;
    return a.ss < b.ss;
}
 
typedef tree<int, null_type, less<int >, rb_tree_tag, 
             tree_order_statistics_node_update> pbds; 
 
int main(){
    c_p_c();
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n,k,sum=1;
    cin>>n>>k;
    vll v(n),temp1(1,1);
    from(i,n)cin>>v[i];
    ll a[n][k+1];
    from(i,n)a[i][0]=1;
    fromj(i,1,k+1){
    	if(v[0]==i)a[0][i]=1;
    	else a[0][i]=0;
    	sum=(a[0][i]+sum)%mod;
    	temp1.pb(sum);
    } 	
    //printv(temp1);
    fromj(i,1,n){
    	fromj(j,1,k+1){
    		if(j<=v[i])a[i][j]=temp1[j];
    		else a[i][j]=(temp1[j]-temp1[j-v[i]-1])%mod;
    	}
    	sum=0;
    	from(j,k+1){
    		sum=(a[i][j]+sum)%mod;
    		temp1[j]=sum;
    	}
    }
    from(i,n){
    	from(j,k+1)cout<<a[i][j]<<" ";
    	cout<<"\n";
    }
    cout<<a[n-1][k];
}