#include <bits/stdc++.h>
using ll = long long;
using namespace std;

const ll mod = 1e9 + 7;
ll n, k, a[104];
ll dp[104][100005];
bool used[104][100005];

ll add(ll a, ll b){
    ll res = a + b;
    if(res >= mod){res -= mod;}
    return res;
}

ll rec(ll pos, ll left){
    if(pos == n){ return (left == 0); }
    if(used[pos][left]){ return dp[pos][left]; }
    used[pos][left] = 1;
    for(ll i = 0; i <= a[pos]; ++i){
        if(left - i >= 0){
            dp[pos][left] = add(dp[pos][left], rec(pos+1, left-i);
        }else{
            break;
        }
    }
    return dp[pos][left];
}

int main() {
    scanf(%lld%lld, &n, &k);
    for(ll i = 0; i < n; i++){
        scanf(%lld, &a[i]);
    }
    printf(%lld, rec(0, k));
	return 0;
}