#include<bits/stdc++.h>
using namespace std;
long long mod = 1e9 + 7;
long long bigmod(long long a, long long p){
    if(p == 0){
        return 1;
    }
    long long ans = bigmod(a, p/2);
    ans = (ans * ans) % mod;
    if(p % 2 == 1){
        ans = (ans * a) % mod;
    }
    return ans;
}
long long nCr(long long n, long long r){
    if(r > n){
        return 0;
    }
    long long lob = 1, hor = 1;
    for(long long i = 1; i <= r; i++){
        lob = (lob * (n - i + 1)) % mod;
        hor = (hor * i) % mod;
    }
    hor = bigmod(hor, mod - 2);
    return (hor * lob) % mod;
}
int main(){
    long long n, m;
    cin >> n >> m;
    long long sum = 0;
    for(long long i = 1; i <= n; i++){
        long long x;
        cin >> x;
        sum += x;
    }
    cout << nCr(m + n, sum + n);
    return 0;
}
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using namespace std;

typedef long long ll;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    ll N, M, MOD = 1e9 + 7, ans = 1;
    cin >> N >> M;
    ll S = 0;
    vector<ll> A(N);
    rep(i, N) {
        cin >> A[i];
        S += A[i];
    }
    if (S > M) {
        cout << "0\n";
        return 0;
    }
    rep(i, S + N) {
        ans *= M + N - i;
        ans %= MOD;
        ans *= mod_pow(i + 1, MOD - 2, MOD);
        ans %= MOD;
    }
    cout << ans << "\n";
}