#include <cstdio>

#define For(i, l, r) for(i=int(l); i<=int(r); i++)
#define Fo(i, n) For(i, 1, n)

typedef long long int64;

const int MOD = 1e9 + 7;

inline int qpow(int64 b, int p, int mod=MOD) {
	int res=1;
	while(p) {
		if(p & 1)
			res=res*b%mod;
		b=b*b%mod;
		p>>=1;
	}
	return res;
}

int main() {
	int i, sum = 0;
	int x, invx;
	int n, m;

	scanf("%d %d", &n, &m);
	Fo(i, n) {
		scanf("%d", &x);
		sum += x;
	}
	sum += n;
	m += n;

	if(sum > m) {
		printf("0\n");
		return 0;
	}
	x = invx = 1;
	Fo(i, sum) {
		x = x * (m - i + 1LL) % MOD;
		invx = 1LL * invx * i % MOD;
	}
	
	printf("%lld\n", 1LL * x * qpow(invx, MOD - 2) % MOD);

	return 0;
}
#include <bits/stdc++.h>
using namespace std;

int main() {
    int n, k, m, sum = 0, ans;
    cin >> n >> k >> m;
    for (int i = 1; i < n; i++) {
        int p;
        cin >> p;
        sum += p;
    }
    if (m * n - sum < 0)
        ans = 0;
    else if (k < m * n - sum)
        ans = -1;
    else
        ans = m * n - sum;
    cout << ans << endl;
}
