#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;

// a^n (mod.MOD)を求める。計算量はO(logn)
ll modpow(ll a, ll n, ll MOD = mod) {
    if(n == 0) {
        return 1;
    }
    if(n%2 == 1) {
        return (a * modpow(a, n-1, MOD))%MOD;
    }
    return (modpow(a, n/2, MOD) * modpow(a, n/2, MOD))%MOD;
}

// nCrをO(r)で求める。
ll Comb(ll n, ll r) {
    if(n < r) {
        return 0;
    }
    if(r > n-r) {
        return Comb(n, n-r);
    }
    ll Mul = 1;
    ll Div = 1;
    rep(i, r) {
        Mul *= (n-i);
        Div *= (i+1);
        Mul %= mod;
        Div %= mod;
    }
    ll res = Mul*modpow(Div, mod-2)%mod;
    return res; 
}

int main() {
    ll n, m;
    cin >> n >> m;

    ll s = 0;
    rep(i, n) {
        ll a;
        cin >> a;
        s += a;
    }
    
    out(Comb(n+m, n+s));
    re0;
}
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <functional>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <bitset>
#include <math.h>
#include <random>
#include <chrono>
using namespace std ;
using ll = long long ;
using ld = long double ;
template<class T> using V = vector<T> ;
template<class T> using VV = V<V<T>> ;
using pll = pair<ll,ll> ;
#define all(v) v.begin(),v.end()
ll mod = 1000000007 ;
long double pie = acos(-1) ;
ll INF = 1000000000000 ;

void yorn(bool a){if(a) cout << "Yes" << endl ; else cout << "No" << endl ;}
//void YorN(bool a){if(a) cout << "YES" << endl ; else cout << "NO" << endl ;}
ll gcd(long long a,long long b){if(b==0) return a ; return gcd(b,a%b) ;}
ll lcm(long long a,long long b){return a/gcd(a,b)*b ;}
void fix_cout(){cout << fixed << setprecision(20) ;}
template<class T> void chmax(T &a,T &b){if(a<b) a = b ;}
template<class T> void chmin(T &a,T &b){if(a>b) a = b ;}

// fac:階乗, inv:逆元, finv:階乗の逆元
vector<long long> fac,inv,finv ;

// nまでの配列を用意する
void nCr_set(int n){
    fac = inv = finv = vector<long long>(n+1,1) ;
	for(int i=2;i<=n;i++){
		fac[i] = fac[i-1]*i%mod ;
		inv[i] = mod-inv[mod%i]*(mod/i)%mod ;
		finv[i] = finv[i-1]*inv[i]%mod ;
	}
}

// nCrを計算して返す
ll nCr(int n,int r){
	if(n<0||r<0||n<r) return 0 ;
	if(n==r||r==0) return 1 ;
	return fac.at(n)*finv.at(n-r)%mod*finv.at(r)%mod ;
}

// nHrを計算して返す
ll nHr(int n,int r) {
	return nCr(n+r-1,n-1) ;
}

// Nが巨大なときにnCrをO(r)で計算して返す
ll nCr_big_n(ll n,ll r){
    ll res = 1 ;
    for(ll i=n-r+1;i<=n;i++) res = i%mod*res%mod ;
    return res*finv[r]%mod ;
}

int main(){
    ll n,m ;
    cin >> n >> m ;
    ll sum = 0 ;
    nCr_set(5e6) ;
    for(int i=0;i<n;i++){
        ll a ; cin >> a ;
        sum += a ;
    }
    if(m<sum){
        cout << 0 << endl ;
        return 0 ;
    }
    cout << nCr_big_n(m+n,sum+n) << endl ;
}