f[i][j]:i种花放j盆的方案数
#include<bits/stdc++.h>
using namespace std;
const int maxn = 3e2+11;
const int mod = 1000007;
typedef long long ll;
ll f[maxn][maxn],a[maxn],n,m;
#define rep(i,j,k) for(int i = j; i <= k; i++)
#define rrep(i,j,k) for(int i = j; i >= k; i--)
int main(){
ios::sync_with_stdio(0);
while(cin>>n>>m){
rep(i,1,n) cin>>a[i];
memset(f,0,sizeof f);
rep(i,0,n) f[i][0]=1;
rep(i,1,n) rep(j,1,m) rrep(k,j,j-a[i])
if(k>=0) f[i][j]=(f[i][j]+f[i-1][k])%mod;
cout<<f[n][m]<<endl;
}
return 0;
}