/*input

*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define bits(x,i) (((x) >> (i)) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
#define ll long long
using namespace std;
const int N = 2005;
int n,m;
int a[N];
const int mod = 1e9 + 7;
ll power(ll x, ll n){
	ll ans = 1;
	for(int i=0;i<31;++i){
		if (bits(n, i)) ans = (ans * x) % mod;
		x = (x * x) % mod;
	}
	return ans;
}
ll inv(ll num, ll den){
	return (num * power(den, mod - 2)) % mod;
}
int s = 0;
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> n >> m;
	up(i,1,n) cin >> a[i], s += a[i];
	ll ans = 1;
	if (m < s) { cout << "0"; return 0; } 
	up(i, m - s + 1, m + n) ans = (ans * i) % mod;
	up(i,2,s + n) ans = inv(ans, i);
	cout << ans; 
}
#include <cstdio>
#include <algorithm>
using namespace std;
typedef long long LL;
LL mod = 1e9 + 7;
const int MAXN = 4e6 + 5 + 2e3;

LL inv[MAXN];

LL C(LL a , LL b) {
	LL res = 1;
	for (LL i = 1; i <= b; ++i) {
		res = res * (a - i + 1) % mod * inv[i] % mod;
	}
	return res;
}

int main() {
	inv[1] = 1;
	for (int i = 2; i <= MAXN - 5; ++i) inv[i] = (mod - mod / i) * inv[mod % i] % mod;
	LL n , m;
	scanf("%lld %lld" , &n , &m);
	LL tot = 0;
	for (int i = 1; i <= n; ++i) {
		int x;scanf("%d" , &x);
		tot += x;
	}
	printf("%lld" , C(m + n , tot + n));
	return 0;
}