#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define ls rt<<1
#define rs rt<<1|1
const int N=2e5+5;
const ll REQ=1e13;
const int INF=0x3f3f3f3f;
const int mod=1e9+7;
const double eps=1e-9;
const double pi=acos(-1);
ll quick(ll a,int n){
	ll re=1;
	while(n){
		if(n&1) re=(re*a)%mod;
		a=(a*a)%mod;
		n>>=1;
	}
	return re;
}
ll inv(ll a){return quick(a,mod-2);}
ll C(int n,int m){		//n里选m
	m=min(m,n-m);
	ll r1=1,r2=1;
	for(int i=n;i>n-m;--i) r1=(r1*i)%mod;
	for(int i=2;i<=m;++i) r2=(r2*i)%mod;
	return r1*inv(r2)%mod;
}
int main(){
	int n,m;scanf("%d%d",&n,&m);
	int sum=0;
	for(int i=1;i<=n;++i){
		int a;scanf("%d",&a);
		sum+=a;
	}
	if(m<sum) puts("0");
	else printf("%lld\n",C(n+m,n+sum));
	return 0;
}
#include <bits/stdc++.h>
#define rei register int
#define int long long
using namespace std;

const int N=2e3+100,mod=1e9+7;
int n,m,a[N];

inline int read(){
    int sum=0,sign=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){
       if(ch=='-') sign=-1;
       ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        sum=(sum<<1)+(sum<<3)+(ch^48);
        ch=getchar();
    }
    return sum*sign;
}

inline int Qpower(long long base, long long power) {
    int result = 1;
    base%=mod;
    while (power > 0) {
        if (power & 1) {
            result = result * base%mod;
        }
        power >>= 1;
        base = (base * base)%mod;
    }
    return result;
}

signed main(){
	scanf("%lld%lld",&n,&m);
	int sum=0;
	for(rei i=1;i<=n;++i) sum+=read();
	if(m<sum){
		printf("0\n");
		return 0;
	} 
	//ans=(∑Ai+N)
	//    (M+N   )  
	m+=n,sum+=n;
	int ans=1;
	for(rei i=1;i<=sum;++i){
		ans=ans*Qpower(i,mod-2)%mod *(m-i+1) %mod;
	}
	printf("%lld\n",ans);
	return 0;
}