#include<iostream>
#include<stdio.h>
#include<vector>
#include<algorithm>
#include<list>
#include<string.h>
#include<math.h>
#include<set>
#include<string>
#include<queue>
#include<map>
#include<unordered_map>
#include<stack>
//#include<unordered_set>
//#pragma GCC optimize (3)
 
//#define segmenttree true
 
#ifdef segmenttree
#define lc (rt<<1)
#define rc (lc|1)
#define mid ((l+r)>>1)
#endif
 
#define reg register
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef pair<int, ll> pil;
typedef pair<double, double> pdd; 
typedef pair<char, char> pcc;
typedef pair<ll, bool> plb;
 
const int MAX = 2005;
const ll INF = 1e10;
const ll MOD = 1e9 + 7;
const double PI = 3.1415926535;
const double EPS = 1e-5;

ll n, m, a, Sum;

inline ll pow_mod(ll a, ll b, ll mod){
    ll ans = 1;
    a %= mod;
    while(b)
    {
        if(b & 1) ans = ans * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return ans;
}

inline ll inv(ll num, ll mod){
    return pow_mod(num, mod - 2, mod) % mod;
}

ll C(ll x, ll y){
	ll temp = 1;
	for(int i = 1; i <= y; ++i){
		temp = temp * (x - i + 1) % MOD;
		temp = temp * inv(i, MOD) % MOD;
	}
	return temp;
}

int main(){
//	ios::sync_with_stdio(false);
	scanf("%lld %lld", &n, &m);
	for(int i = 1; i <= n; ++i){
		scanf("%lld", &a);
		Sum += a;
	}
	printf("%lld", C(m + n, n + Sum));
	return 0;
}
#include <bits/stdc++.h>
using namespace std;

typedef int_fast32_t int32;
typedef int_fast64_t int64;

const int32 inf = 1e9+7;
const int32 MOD = 1000000007;
const int64 llinf = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define all(obj) (obj).begin(),(obj).end()
#define rall(obj) (obj).rbegin(),(obj).rend()
#define fi first
#define se second
#define pb(a) push_back(a)
typedef pair<int32,int32> pii;
typedef pair<int64,int64> pll;

template<class T> inline bool chmax(T& a, T b) {
  if (a < b) { a = b; return true; } return false;
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) { a = b; return true; } return false;
}

template<int64 mod>
struct ModInt{
  int64 x;
  constexpr ModInt(int64 y = 0):x((y%mod+mod)%mod){}
  constexpr ModInt& operator+=(const ModInt& a){
    if((x += a.x) >= mod) x -= mod;
    return *this;
  }
  constexpr ModInt& operator-=(const ModInt& a){
    if((x -= a.x) < 0)x += mod;
    return *this;
  }
  constexpr ModInt& operator*=(const ModInt& a){
    x = x * a.x % mod;
    return *this;
  }
  constexpr ModInt& operator/=(const ModInt& a){
    *this *= a.inv();
    return *this;
  }
  constexpr ModInt operator-() const {
    return ModInt(-x);
  }
  constexpr ModInt operator+(const ModInt& a) const {
    return ModInt(*this) += a;
  }
  constexpr ModInt operator-(const ModInt& a) const {
    return ModInt(*this) -= a;
  }
  constexpr ModInt operator*(const ModInt& a) const {
    return ModInt(*this) *= a;
  }
  constexpr ModInt operator/(const ModInt& a) const {
    return ModInt(*this) /= a;
  }
  constexpr ModInt operator++(){
    *this += ModInt(1);
    return *this;
  }
  constexpr ModInt operator++(int){
    ModInt old = *this;
    ++*this;
    return old;
  }
  constexpr ModInt operator--(){
    *this -= ModInt(1);
    return *this;
  }
  constexpr ModInt operator--(int){
    ModInt old = *this;
    --*this;
    return old;
  }
  constexpr bool operator==(const ModInt& a) const {
    return x == a.x;
  }
  constexpr bool operator!=(const ModInt& a) const {
    return x != a.x;
  }
  constexpr ModInt pow(int64 r) const {
    if(!r)return 1;
    ModInt res = pow(r>>1);
    res *= res;
    if(r & 1) res *= *this;
    return res;
  }
  constexpr ModInt inv() const {
    return pow(mod-2);
  }
  friend istream& operator>>(istream& is, ModInt& a){
    int64 t;
    is >> t;
    a = ModInt(t);
    return is;
  }
  friend ostream& operator<<(ostream& os, const ModInt& a){
    return os << a.x;
  }
};
using mint = ModInt<MOD>;

mint comb(int32 n, int32 r){
  if(r > n)return 0;
  r = min(r,n-r);
  mint res = 1;
  REP(i,r){
    res *= n-i;
    res /= i+1;
  }
  return res;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int32 n,m;
  cin >> n >> m;
  vector<int32> a(n);
  REP(i,n)cin >> a[i];

  // {
  //   vector<vector<mint>> dp(n+1,vector<mint>(m+1));
  //   dp[0][0] = 1;
  //   REP(i,n){
  //     REP(j,m+1){
  //       REP(k,j+1){
  //         // dp[i+1][j] += dp[i][j-k] * comb(k,a[i]);
  //         dp[i+1][j] += dp[i][k] * comb(j-k,a[i]);
  //       }
  //     }
  //   }
  //   mint ans = 0;
  //   REP(i,m+1)ans += dp[n][i];
  //   ANS(ans);
  //   REP(i,m+1){
  //     REP(j,n+1){
  //       cout << dp[j][i] << " ";
  //     }
  //     cout << endl;
  //   }
  // }
  
  {
    int64 sumA = 0;
    REP(i,n)sumA += a[i];
    // mint ans = 0;
    // REP(i,m+1-sumA){
    //   ANS(comb(sumA + n + i - 1, i));
    //   ans += comb(sumA + n + i - 1, i);
    // }
    // ANS(ans);

    // ANS(comb(n+m,m-sumA));

    ANS(comb(n+m,n+sumA));
  }


  return 0;
}