#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define ll long long int
#define inf 1000000000000
#define MOD 1000000007
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define for0(i, n) for (int i = 0; i < n; i++)
#define tc(t) int t; cin >> t; while (t--)
#define maxpq priority_queue<int>
#define minpq priority_queue<int, vector<int>, greater<int> >
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define S(x) (int)(x).size()
#define L(x) (int)(x).length()
#define ps(x,y)         fixed<<setprecision(y)<<x
using namespace std;
using namespace __gnu_pbds;
ll arr[105];
int n;
ll k;
ll cnt = 0;
ll dp[100][100005];
int candies(int pos, ll rem)
{
	if (pos == n)
	{
		if (rem == 0)
		{
			return 1;
		}
		else
			return 0;
	}
	if (rem < 0)
		return 0;
	if (dp[pos][rem] != 0)
		return dp[pos][rem] %= MOD;
	for (int i = arr[pos]; i >= 0; i--)
	{
		dp[pos][rem] += candies(pos + 1, rem - i);
		dp[pos][rem] %= MOD;
	}
	return dp[pos][rem] %= MOD;
}
int main()
{
	IOS
/*#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif*/

	cin >> n >> k;
	memset(dp, 0, sizeof(dp));
	for (int i = 0; i < n; i++)
		cin >> arr[i];
	ll res = candies(0, k);
	cout << res << endl;
}
