#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
const int MN = 2020;
const ll M = 1e9+7;
inline ll mul(ll a, ll b) {
	return (a*b)%M;
}
ll bp(ll b, ll p) {
	ll ac = 1;
	while(p) {
		if(p&1) {
			ac = mul(ac,b);
		}
		b = mul(b,b);
		p >>= 1;
	}
	return ac;
}
ll prf[MN*MN];
ll fac(ll val) {
	if(val <= 1) {return 1;}
	if(prf[val] != -1) {return prf[val];}
	prf[val] = mul(fac(val-1),val);
	return prf[val];
}
ll inv(ll val) {
	return bp(val,M-2);
}
ll ch(ll n, ll k) {
	ll num = 1;
	for(ll i=0;i<k;i++) {
		num = mul(num,n-i);
	}
	ll dem = fac(k);
	return mul(num,inv(dem));
}
vl w;
int main() {
	memset(prf,-1,sizeof(prf));
	ll n,m;
	cin >> n >> m;
	ll su = 0;
	for(int i=0;i<n;i++) {
		ll a;
		cin >> a;
		w.push_back(a);
		su += a;
	}
	su += n;
	m += n;
	cout << ch(m,su) << '\n';
}

// Problem: D - Binomial Coefficient is Fun
// Contest: AtCoder - AtCoder Regular Contest 110（Sponsored by KAJIMA CORPORATION）
// Time: 2020-12-14 00:33:52

// 私に忍び寄るのをやめてください、ありがとう

#include<bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll long long
#define int long long
#define mod 1000000007 //998244353
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define fore(i, a, b) for (ll i = (ll)(a); i <= (ll)(b); ++i)
#define nl "\n"
#define trace(x) cerr<<#x<<": "<<x<<" "<<endl
#define trace2(x, y) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z) cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define x first
#define y second
#define vc vector
#define pb push_back
#define ar array
#define all(a) (a).begin(), (a).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ms(v,n,x) fill(v,v+n,x);
#define init(c,a) memset(c,a,sizeof(c))
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define inf 9e18
#define cases ll T;cin>>T;while(T--)
#define BLOCK 500
//const double PI = 3.141592653589793238460;
template<typename T> bool mmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool mmin(T &m, const T q) { if (m > q) {m = q; return true;} else return false; }
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
// void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

mt19937_64 rng(chrono::high_resolution_clock::now().time_since_epoch().count());

int power(int a,int b){
    int res = 1;
    while(b){
        if(b&1){
            res = res*a;
            res %= mod;
        }
        a=a*a;
        a%=mod;
        b=b/2;
    }
    return res;
}

int inverse(int x){
    return power(x,mod-2);
}

int const N = 5e6+55;
int fact[N], ifact[N];

void precompute(){
    fact[0] = 1;
    for(int i=1;i<N;i++){
        fact[i] = fact[i-1]*i;
        fact[i] %= mod;
    }
    ifact[N-1] = inverse(fact[N-1]);
    for(int i=N-2;i>=0;i--){
        ifact[i] = (i+1)*ifact[i+1];
        ifact[i] %= mod;
    }
}

ll ncr(ll x,ll y){
	ll now=x,ans=1;
	now%=mod;
	f(i,y){
		ans=ans*now%mod;
		now=(now-1+mod)%mod;
		//if(now<0)return 0;
	}	
	
	ans=ans*ifact[y]%mod;
	return ans;
	
}

int32_t main()
{
    
	fast	
	cout << fixed << setprecision(12);
	ll n,m;
	cin>>n>>m;
	precompute();
	vll a(n);
	ll s=0;
	f(i,n){
		cin>>a[i];
		s+=a[i];
	}
	
	cout<<ncr(m+n,s+n);

	return 0;
    
}