#include <iostream>
#include <cstring>
#include <algorithm>
#define MOD 1000000007
using namespace std;

int n, k, arr[101], dp[101][100001], pre[101][100001], top=0;

int main(void){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>n>>k;
	for(int i=0;i<n;i++){
      cin>>arr[i];
    	top+=arr[i];
    }
     sort(arr, arr+n);
	for(int i=0;i<=arr[0];i++){
		dp[0][i]=1;
		pre[0][i]=i+1;
	}
  long long int ek=arr[0];
	for(int i=1;i<n;i++){
		dp[i][0]=1;
		pre[i][0]=1;
		for(int j=1;j<=min(arr[i]+ek, k+1);j++){
			if(j-arr[i]-1>-1)dp[i][j]=(pre[i-1][ek]-pre[i-1][j-arr[i]-1])%MOD;
			else dp[i][j]=pre[i-1][min(j, ek)];
			pre[i][j]=(dp[i][j]+pre[i][j-1])%MOD;
		}
      if(ek+arr[i]<=k)ek+=arr[i];
	}
	cout<<dp[n-1][k];
	return 0;
}
