#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fr(i,j,n)   for(long long i=j;i<(n);++i)
#define bk(i,j,n)   for(long long i=j;i>=n;--i)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define endl "\n"
#define MOD 1000000007
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define srt(x) sort(x.begin(),x.end());
#define ret     return 0;
#define mem(x,y)    memset((x),(y),sizeof (x));
#define run ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ordered_set tree<ll , null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>

typedef long long ll;

//std::cout << std::setprecision(12) << s << '\n';
ll modpower(ll a,ll b,ll c)
{
	ll res=1;
	while(b)
	{
		if(b&1LL)
			res=(res*a)%c;
		a=(a*a)%c;
		b>>=1;
	}
	return res;
}

ll n,k;
ll a[105];
ll dp[105][100005];
ll vis[105][100005];
ll fun(ll ind,ll left)
{


    if(ind==n)
    {
        if(left)
        {
            return 0;
        }
        return 1;

    }
    if(vis[ind][left])
    {
        return dp[ind][left];
    }

    vis[ind][left]=1;


    ll c=0;
    fr(i,0,min(a[ind]+1,left+1))
    {
        c+=fun(ind+1,left-i);
        c%=MOD;
    }
    dp[ind][left]=c;
    return c;
}

int main()
{
    run;
    cin>>n>>k;
    fr(i,0,n)
    {
        cin>>a[i];
    }
    sort(a,a+n);
    cout<<fun(0,k);









}
