#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<string> vs;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<vp> vvp;

const ll MOD = 1e9 + 7;

// input
ll N, M;
vi A;


void input() {
    cin >> N >> M;
    A = vi(N);
    rep(i, N) cin >> A[i];
}


int main() {
    input();
    ll s = accumulate(A.begin(), A.end(), 0LL);
    ll a = 1;
    rep(i, s + N) a = a * (M + N - i) % MOD;
    vl inv(s + N + 1), finv(s + N + 1);
    inv[1] = 1;
    finv[0] = finv[1] = 1;
    for (int i = 2; i <= s + N; i++){
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
    ll b = finv[s + N];
    ll ans = a * b % MOD;
    cout << ans << endl;
}

#include <stdio.h>
long long p = 1000000007;
long long n, m, s;
long long x, y, z;
long long a[2000];
long long inv[5000000];
void makeinv(void) {
	long long arraynumber = sizeof inv / sizeof inv[0];
	inv[1] = 1;
	for (int invcount = 2; invcount < arraynumber; invcount++) {
		inv[invcount] = p - inv[p % invcount] * (p / invcount) % p;
	}
}
int main() {
	makeinv();
	scanf("%lld%lld", &n, &m);
	for (int i = 0; i < n; i++) {
		scanf("%lld", a + i);
		s += a[i];
	}
	if (m < s) {
		printf("0\n");
		return 0;
	}
	x = m + n;
	y = s + n;
	z = 1;
	for (long long i = 0; i < y; i++) {
		z *= (x - i);
		z %= p;
	}
	for (long long i = 1; i <= y; i++) {
		z *= inv[i];
		z %= p;
	}
	printf("%lld\n", z);
}