#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define pii pair<int,int>
#define pll pair<ll,ll>
#define ldb double
template<typename T>void ckmn(T&a,T b){a=min(a,b);}
template<typename T>void ckmx(T&a,T b){a=max(a,b);}
void rd(int&x){scanf("%i",&x);}
void rd(ll&x){scanf("%lld",&x);}
void rd(char*x){scanf("%s",x);}
void rd(ldb&x){scanf("%lf",&x);}
void rd(string&x){scanf("%s",&x);}
template<typename T1,typename T2>void rd(pair<T1,T2>&x){rd(x.first);rd(x.second);}
template<typename T>void rd(vector<T>&x){for(T&i:x)rd(i);}
template<typename T,typename...A>void rd(T&x,A&...args){rd(x);rd(args...);}
template<typename T>void rd(){T x;rd(x);return x;}
int ri(){int x;rd(x);return x;}
template<typename T>vector<T> rv(int n){vector<T> x(n);rd(x);return x;}
template<typename T>void ra(T a[],int n,int st=1){for(int i=0;i<n;++i)rd(a[st+i]);}
template<typename T1,typename T2>void ra(T1 a[],T2 b[],int n,int st=1){for(int i=0;i<n;++i)rd(a[st+i]),rd(b[st+i]);}
template<typename T1,typename T2,typename T3>void ra(T1 a[],T2 b[],T3 c[],int n,int st=1){for(int i=0;i<n;++i)rd(a[st+i]),rd(b[st+i]),rd(c[st+i]);}
void re(vector<int> E[],int m,bool dir=0){for(int i=0,u,v;i<m;++i){rd(u,v);E[u].pb(v);if(!dir)E[v].pb(u);}}
template<typename T>void re(vector<pair<int,T>> E[],int m,bool dir=0){for(int i=0,u,v;i<m;++i){T w;rd(u,v,w);E[u].pb({v,w});if(!dir)E[v].pb({u,w});}}

const int mod=1e9+7;//998244353
int add(int a,int b){a+=b;return a>=mod?a-mod:a;}
void ckadd(int&a,int b){a=add(a,b);}
int sub(int a,int b){a-=b;return a<0?a+mod:a;}
void cksub(int&a,int b){a=sub(a,b);}
int mul(int a,int b){return (ll)a*b%mod;}
void ckmul(int&a,int b){a=mul(a,b);}
int powmod(int x,int k){int ans=1;for(;k;k>>=1,ckmul(x,x))if(k&1)ckmul(ans,x);return ans;}
int inv(int x){return powmod(x,mod-2);}

// D

int main(){
	int n,m;
	rd(n,m);
	auto a=rv<int>(n);
	int sumA=0;
	for(int i:a)sumA+=i;
	int N=m+n;
	int K=sumA+n;
	int ans=1;
	if(K>N)ans=0;
	else{
		for(int i=1;i<=K;i++){
			ckmul(ans,N-i+1);
			ckmul(ans,inv(i));
		}
	}
	printf("%i\n",ans);
	return 0;
}

#include <bits/stdc++.h>
// clang-format off
using namespace std; using ll=long long; using ull=unsigned long long; using pll=pair<ll,ll>; const ll INF=4e18;
void print0() {}
template<typename H,typename... T> void print0(H h,T... t){cout<<fixed<<setprecision(15)<<h;print0(t...);}
void print() { print0("\n"); }
template<typename H,typename... T>void print(H h,T... t){print0(h);if(sizeof...(T)>0)print0(" ");print(t...);}
void ioinit() { cout << fixed << setprecision(15); ios_base::sync_with_stdio(0); cin.tie(0); }
// clang-format on

ll gcdf(ll a, ll b) {
    if (b == 0) {
        return a;
    }
    return gcdf(b, a % b);
}

vector<ll> mkprimes(ll N) {
    vector<bool> isprime(N + 1);
    vector<ll> primes;
    for (ll i = 0; i <= N; i++) {
        isprime[i] = true;
    }
    isprime[0] = false;
    isprime[1] = false;

    for (ll i = 2; i <= N; i++) {
        if (isprime[i]) {
            primes.push_back(i);
            for (ll j = 2 * i; j <= N; j += i) {  // 素数iの倍数は素数ではない
                isprime[j] = false;
            }
        }
    }
    return primes;
}

void update(ll org, vector<ll> &primes, ll ngp, set<ll> &result) {
    if (org > 10000) return;
    ll c = primes.size();
    result.insert(org);
    for (ll j = 0; j < c; j++) {
        if (j != ngp) {
            update(org * primes[j], primes, ngp, result);
        }
    }
}
int main() {
    vector<ll> primes = mkprimes(10000);
    ll c = primes.size();

    set<ll> r0;
    update(6, primes, 2, r0);
    update(10, primes, 1, r0);
    update(15, primes, 0, r0);
    update(30, primes, INF, r0);
    vector<ll> r3 = {6, 10, 15};
    for (auto p : r0) {
        if (p != 6 && p != 10 && p != 15) {
            r3.push_back(p);
        }
    }

    ll n;
    cin >> n;
    {
        //print(r3.size());
        if (r3.size() < n) return 0;
        vector<ll> r4;
        for (ll i = 0; i < n; i++) {
            r4.push_back(r3[i]);
        }
        for (ll i = 0; i < n; i++) {
            for (ll j = i + 1; j < n; j++) {
                assert(gcdf(r4[i], r4[j]) > 1);
                assert(r4[i] != r4[j]);
            }
        }
        ll g = r4[0];
        for (ll i = 0; i < n; i++) {
            g = gcdf(g, r4[i]);
        }
        assert(g == 1);
    }
    for (ll i = 0; i < n; i++) {
        if (i > 0) print0(" ");
        print0(r3[i]);
    }
    print();
}
