#include<cstdio>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
const int mod=1e9+7;
int n,m;
int sa;
int ans1,ans2;
int ksm(ll ta,int tp){
    int s=1;
    for(;tp;ta=ta*ta%mod,tp>>=1) if(tp&1) s=ta*s%mod;
    return s;
}
int main(){
    scanf("%d %d",&n,&m);
    m+=n;
    for(int i=1,a;i<=n;i++){
        scanf("%d",&a); sa+=a;
    }
    sa+=n;
    ans1=ans2=1;
    if(m<sa){
        printf("0\n");
        return 0;
    }
    for(int i=1;i<=sa;i++) ans1=1ll*ans1*i%mod;
    for(int i=1;i<=sa;i++) ans2=1ll*ans2*(m-i+1)%mod;
    printf("%lld\n",1ll*ans2*ksm(ans1,mod-2)%mod);
    return 0;
}

#include <bits/extc++.h>
using namespace std;
using namespace __gnu_cxx;

template<typename T>
int ex(T p){
  T a = 1;
  if(p == 0){
    return a;
  }
  else{
    for(T i = 1; i <= p; i++){
      a = a*i%1000000007;
    }
    return a;
  }
}
template<typename T>
int eq(T p, T q){
    T r,s = 0,nextp,prevp = 0,prev2p = 1;
    if(q != 1){
        while(s != 1){
            r = p/q; s = p%q;
            nextp = prevp;
            prevp = prev2p - r * prevp;
            prev2p = nextp;
            p = q; q = s;
        }
    return prevp;
    }
    else{
      return 0;
    }
} 
template<typename T>
int com(T p,T q){
  T a,b,c,mod = 1000000007;
  a = ex(p);
  b = ex(q);
  for(T i = 1; i <= p-q; i++){
    b = b*i%mod;
  }
  if(b != 1){
    c = ((1 - eq(mod,b)*mod )/b + mod) %mod;
  }
  else{
    c = 1;
  }
  return a*c%mod;
}
template<typename T>
int gcd(T p,T q){
    T s;
    while(q != 0){
        s = p%q;
        p = q; q = s;
    }
    return p;
}

template<typename T>
int point(const vector<T> &P){
  T sum = 0;
  for(T i = 1; i < 10; i++){
    if(P[i] == 0){
      sum += i;
    }
    else{
      T t = 1;
      for(T j = 0; j < P[i]; j++){
        t*=10;
      }
      sum += i*t;
    }
  }
  return sum;
} 

int main() {
  int a,b;
  cin >> a >> b;
  cout << 2*a-b+100 << endl;
}