#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define sz(x) (int)x.size()
#define cat(x) cerr << #x << " = " << x << endl
 
using ll = long long;
using namespace std;

const int MOD = 1e9 + 7;

ll bin_pow(ll a, ll b) {
	ll c = 1;
	while (b) {
		if (b & 1) c = c * a % MOD;
		a = a * a % MOD;
		b >>= 1;
	}
	return c;
}

int n, m, a, s;

int main() {
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for (int i = 0; i < n; ++i) {
		cin >> a;
		s += a;
	}
	int x = n + m - 1 + 1;
	int y = s + n - 1 + 1;
	//~ cout << x << " " << y << endl;
	if (x < y) {
		cout << 0 << endl;
	}
	else {
		ll res = 1;
		for (int i = 1; i <= y; ++i)
			res = res * bin_pow(i, MOD - 2) % MOD * (x - i + 1) % MOD;
		cout << res << endl;
	}
	return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<float.h>
#include<tuple>
#include<string.h>
#include<iomanip>
#include<stack>
#include<queue>
#include<map>
#include<deque>
#include<math.h>

using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define REP(i,n) for(ll i=1;i<=n;i++)
#define ALLOF(c) (c).begin(), (c).end()
#define Pa pair<ll,ll>
const ll mod=1000000007;
const ll modq=998244353;
const ll INF=1e12;
const ll inf=-1;
ll ABS(ll a){return max(a,-a);}

ll modpow(ll a,ll n) {
    ll res = 1;
    while (n>0) {
        if(n&1) res=res*a%mod;
        a=a*a%mod;
        n>>=1;
    }
    return res;
}

// a^{-1} mod を計算する
ll modinv(ll a) {
    return modpow(a, mod - 2);
}

ll nCk(ll n,ll k){
    ll nck=1;
    rep(i,k){
        nck=(nck*(n-i))%mod;
        nck=(nck*modinv(k-i))%mod;
    }
    return nck;
}
   
int main(void){
    ll N,M,Asum=0;
    cin>>N>>M;
    rep(i,N){
        ll A;
        cin>>A;
        Asum+=A;
    }
    if(M<Asum){
        cout<<0<<endl;
        return 0;
    }
    cout<<nCk(M+N,N+Asum)<<endl;
    return 0;
}