/*
 
 * This code is written by Sanskar Agarwal
 
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 

using namespace __gnu_pbds;
using namespace std;

#define ll long long
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set; 
#define PII pair<int,int>
#define PLL pair<ll,ll>
#define VPLL vector<PLL>
#define VPII vector<PII>
#define PQ priority_queue<PLL,VPLL, greater<PLL> > 
#define PQI priority_queue<PII,VPII,greater<PII> >
#define S second
#define F first
#define PB push_back

const ll MOD=1000000007;
ll dp[101][100001];

int main()
{
    
  
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    ll n,i,k;
    cin>>n>>k;
    ll a[n],sm=0;
    
    for(i=0;i<n;i++) {
    	cin>>a[i];
    	sm+=a[i];
    }
    if(sm<k)
    {
    	cout << "0";
    	return 0;
    }
    sort(a,a+n);
    dp[0][0]=1; 
    for(i=1;i<=n;i++)
    {
        for(ll j=0;j<=a[i-1];j++)
        {
        	if(j==0)
        		dp[i][j]=dp[i-1][j];
            else
                dp[i][j]=(dp[i][j-1]+dp[i-1][j])%MOD;
        }
    }

    cout << dp[n][a[n-1]];

    return 0;
}