#pragma GCC optimize ("Ofast")
#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;
typedef long long int ll;
#define int long long int
#define pb push_back
#define fi first
#define se second
#define deb cerr << "Line no." << __LINE__
#define fr(i, a, b) for(int i = a; i <= b; i++)
#define all(x) x.begin(), x.end()
#define IO ios :: sync_with_stdio(0), cin.tie(0), cout.tie(0)
#define pii pair<int,int>
#define sz(x) (int)x.size()
const int mod = 1e9 + 7;
const int mod1 = 998244353;
typedef long double f80;
#ifndef LOCAL
#define endl '\n'
#endif

template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int rand(int l, int r){
	uniform_int_distribution<int> uid(l, r);
	return uid(rng);
}
int pwr(int a,int b){
	int ans = 1;
	while(b){
		if(b & 1) ans = (ans * a) % mod;
		a = (a * a) % mod;
		b >>= 1;
	}
	return ans;
}
const int N = 1e5 + 5;
int a[N];
int fact[N], ifact[N];
int dp[105][N];
int ncr(int n,int k){
	if(n < k || k < 0) return 0;
	int ans = (fact[n] * ifact[k]) % mod;
	return (ans * ifact[n - k]) % mod;
}
void solve(){
	int n, k;
	cin >> n >> k;
	fr(i, 1, n){
		cin >> a[i];
	}
	fact[0] = 1;
	fr(i, 1, N - 1){
		fact[i] = (fact[i - 1] * i) % mod;
	}
	ifact[N - 1] = pwr(fact[N - 1], mod - 2);
	for(int i = N - 2; i >= 0; i--){
		ifact[i] = (ifact[i + 1] * (i + 1)) % mod;
	}
	dp[0][0] = 1;
	fr(i, 1, n){
		fr(j, 0, k){
			dp[i][j] += dp[i - 1][j];
			if(j >= a[i] + 1)
				dp[i][j]  -= dp[i - 1][j - a[i] - 1];
			dp[i][j] %= mod;
		}
	}
	int ans = 0;
	fr(i, 0, k){
		ans += (ncr(n + i - 1, n - 1) * dp[n][k - i]) % mod;
		ans %= mod;
	}
	ans = (ans + mod) % mod;
	cout << ans;
}
signed main(){
  	IO;
  	#ifdef LOCAL
		freopen("inp.txt","r", stdin);
		// freopen("out.txt", "w", stdout);
	#endif
 	clock_t clk = clock();
  	int t = 1;
  	// cin >> t;
  	fr(tt, 1, t){
    	solve();
  	}
  	cerr << endl << (double)(clock() - clk) / CLOCKS_PER_SEC;
  	return 0;
}