#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;
}
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
long long pow_log(long long x,int y)
{
	if (!y)
	return 1;
	long long ret=pow_log(x,y/2);
	ret=(ret*ret)%mod;
	if (y%2)
	ret=(ret*x)%mod;
	return ret;
}
int main()
{
	int n,m;
	scanf("%d%d",&n,&m);
	m+=n;
	int sum=n;
	for (int i=0;i<n;i++)
	{
		int a;
		scanf("%d",&a);
		sum+=a;
	}
	long long ans=1;
	for (int i=m-sum+1;i<=m;i++)
	ans=(ans*i)%mod;
	for (int i=1;i<=sum;i++)
	ans=(ans*pow_log(i,mod-2))%mod;
	printf("%lld",ans);
}