#include <bits/stdc++.h>

using namespace std;

#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC optimize("-ffloat-store")

#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'

#define sz(a) ((int)(a).size())
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define tr(c, it) for (auto it = (c).begin(); (it) != (c).end(); it++)
#define pres(c, val) ((c).find(val) != (c).end())      // for sets, multisets, maps etc.
#define cpres(c, val) (find((c).begin(), (c).end(), val) != (c).end()) // for others

#define pb push_back
#define mp make_pair
#define F first
#define S second

#define forf(i, a, b) for (int i = (a); i < (b); i++)
#define forb(i, a, b) for (int i = (b); i >= (a); i--)
#define fo(i, n) forf(i, 0, n)
#define fob(i, n) forb(i, 0, n - 1)

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;
typedef vector<pair<int, int>> vpii;

const int INF = 9e18;
const int N = 1000000007;
//const int N = 998244353;
const double eps = 1e-9;

const auto start_time = std::chrono::high_resolution_clock::now();

void zark() {
  #ifdef ZARK
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time - start_time;
    cerr << "Time Taken: " << diff.count() << "s\n";
  #endif
}

#ifdef ZARK
  #include "/home/aranjan/Desktop/CP/header.h"
  #else
  #define debug(args...) 42
#endif

/* ------------------ Actual Coding Starts ------------------ */

int mpow(int a, int n) {
  a %= N;
  if(n == 0) return 1;
  else if(n&1) return (mpow(a, n-1)*a)%N;
  else {
    int k = mpow(a, n/2)%N;
    return (k*k)%N;
  }
}

int inv(int a) {
  a %= N;
  return mpow(a, N-2);
}

void solve() {
  int n, m;
  cin >> n >> m;
  vi a(n);
  fo(i, n) cin >> a[i];
  int s = accumulate(all(a), 0);
  int p1 = 1, p2 = 1;
  forf(i, m-s+1, m+n+1) p1 = (p1*i)%N;
  forf(i, 1, s+n+1) p2 = (p2*i)%N;
  int ans = p1;
  ans = (ans * inv(p2)) % N;
  cout << ans << '\n';
}

int32_t main() {
  fastio;
  #ifdef ZARK
    freopen("input.in", "r", stdin);
  #endif

  //freopen("sort.in", "r", stdin);
  //freopen("txt.out", "w", stdout);
  //cout << fixed << setprecision(10);

  solve();
  zark();
  return 0;
}
#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

template<ll mod = 1000000007LL>
ll modpow(ll a, ll b){
    if (b == 0) return 1LL;
    ll tmp = modpow(a * a % mod, b / 2);
    if (b % 2 == 0) return tmp;
    return tmp * a % mod;
}

template<ll mod = 1000000007LL>
ll comb(ll a, ll b){
    ll n = 1, d = 1;
    for (ll i = 0; i < b; ++i){
        n = n * (i + 1) % mod;
        d = d * (a - i) % mod;
    }
    return d * modpow<mod>(n, mod - 2) % mod;
}

int main(void){
    int N; ll M;
    cin >> N >> M;
    ll S = 0;
    for (int i = 0; i < N; ++i){
        ll ai; cin >> ai;
        S += ai;
    }
    ll ans = comb(N + M, S + N);
    cout << ans << endl;
    return 0;
}