#include<bits/stdc++.h>
using namespace std;
long long dp[105][100015];
long long mod=pow(10,9)+7;



int main()
{
    long long  n,k;
    cin>>n>>k;
    long long* a=new long long[n];
    for(int i=0;i<n;i++)
    cin>>a[i];
    memset(dp,0,sizeof(dp));
    sort(a,a+n);

    for(int id=0;id<n;id++)
    {
      long long pre[k+2]={0};
      if(id!=0)
      {
      pre[0]=dp[id-1][0];
      for(int i=1;i<=k;i++)
      pre[i]=(pre[i-1]+dp[id-1][i]%mod)%mod;
      }
      
      for(int kk=0;kk<=k;kk++)
      {
        if(id==0)
        {
          if(kk>a[id])dp[id][kk]=0;
          else dp[id][kk]=1;
        }
        else if(kk==0)dp[id][kk]=1;
        
        else 
        {
          int l=max((long long)0,kk-a[id]);
          if(l==0)dp[id][kk]=pre[kk];
          else dp[id][kk]=(pre[kk]%mod-pre[l-1]%mod)%mod;

        }
      }
    }
    cout<<dp[n-1][k];
}