#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<float.h>
#include<tuple>
#include<string.h>
#include<iomanip>
#include<stack>
#include<queue>
#include<map>
#include<deque>
#include<math.h>

using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define REP(i,n) for(ll i=1;i<=n;i++)
#define ALLOF(c) (c).begin(), (c).end()
#define Pa pair<ll,ll>
const ll mod=1000000007;
const ll modq=998244353;
const ll INF=1e12;
const ll inf=-1;
ll ABS(ll a){return max(a,-a);}

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

// a^{-1} mod を計算する
ll modinv(ll a) {
    return modpow(a, mod - 2);
}

ll nCk(ll n,ll k){
    ll nck=1;
    rep(i,k){
        nck=(nck*(n-i))%mod;
        nck=(nck*modinv(k-i))%mod;
    }
    return nck;
}
   
int main(void){
    ll N,M,Asum=0;
    cin>>N>>M;
    rep(i,N){
        ll A;
        cin>>A;
        Asum+=A;
    }
    if(M<Asum){
        cout<<0<<endl;
        return 0;
    }
    cout<<nCk(M+N,N+Asum)<<endl;
    return 0;
}
#include <iostream>
#include <cmath>
#include <stdio.h>
#include <string.h>
#include <bits/stdc++.h>
#include <vector>
#include <array> 
#include <tuple>
#include <algorithm>
using namespace std; 

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m; 
    if (u < 0) u += m;
    return u;
}

int main() {
  long long N, M, S, x, P, C;
  cin >> N >> M;
  S=0;
  for (int i=0; i<N; i++){
    cin >> x;
    S=S+x;
  }
  P=1;
  C=1000000007;
  for (int i=0; i<S+N; i++){
    P=(P*(M+N-i))%C;
    P=(P*modinv(S+N-i, C))%C;
  }
  cout << P << endl;
}