#include <cmath>
#include <vector>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <set>
#include <queue>
#include <string>
#include <map>
#include <stack>
#include <climits>
#include <array>
#include <unordered_set>
#include <unordered_map>
#include <memory>
#include <functional>
#include <cfloat>
#include <numeric>
#include <random>
#include <sstream>
#include <bitset>
#include <complex>
#include <chrono>
#include <cassert>
#include <chrono>

constexpr int MOD = 1000000007;
long long int power(long long int base, int exp) {
	long long int result{ 1 };
	while (exp > 0) {
		if (exp & 1) {
			result = (result * base) % MOD;
		}
		exp >>= 1;
		base = (base * base) % MOD;
	}
	return result;
}
long long int combination(const int n, const int r) {
	long long int result{ 1 };
	for (auto i = 0; i < r; ++i) {
		result = (result * (n - i)) % MOD;
	}
	for (auto i = 1; i <= r; ++i) {
		result = result * power(i, MOD - 2) % MOD;
	}
	return result;
}
int main() {
	int n, m; std::cin >> n >> m;
	std::vector<int> series(n);
	for (auto& a : series) std::cin >> a;
	const auto sum = std::accumulate(series.begin(), series.end(), 0);
	if (sum > m) {
		std::cout << "0\n";
		return 0;
	}
	std::cout << combination(n + m, sum + n) << '\n';
}
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
#pragma GCC optimize ("-O3")
#define int long long
#define ld long double
#define endl "\n"

#define rep(i,begin,end) for (__typeof(end) i=begin-(begin>end); i!=(end)-(begin>end); i+=1-2*(begin>end))
#define umap unordered_map
#define pq priority_queue 
#define pb push_back
#define mp make_pair
#define fs first
#define sec second
#define lb lower_bound
#define ub upper_bound
#define mii map<int,int>
#define pii pair<int,int>
#define vc vector
#define vi vc<int>
#define vvi vc<vi>
#define all(v) v.begin(),v.end()
#define tol(s) transform(s.begin(),s.end(),s.begin(),::tolower);
#define tou(s) transform(s.begin(),s.end(),s.begin(),::toupper);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define w(t) int t; cin>>t; rep(tc,0,t)
#define clr(a,x) memset(a,x,sizeof a)

#define chkbit(x,i) ((x)&(1LL<<(i)))
#define setbit(x,i) ((x)|(1LL<<(i)))
#define setbits(x)  __builtin_popcountll(x)
#define zerobits(x) __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x
#define print(a, n) rep(i,0,n) cout<<a[i]<<" "; cout<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const int mod = 1e9+7;
const int mod2 = 998244353;
const int N = 2e6;
const int inf = 1e18;
const ld PI = 3.141592653589793;

//=====================================================


template<typename... T>
void in(T&... args) {((cin>>args), ...);}
template<typename... T>
void out(T&&... args) {((cout<<args<<" "), ...);}
template<typename... T>
void outln(T&&... args) {((cout<<args<<" "), ...); cout<<endl;}

int nxt(){int x;cin>>x;return x;}
int add(int a,int b,int mod){int res=(a+b)%mod;return (res<0)?res+mod:res;}
int mul(int a,int b,int mod){int res=(a*1LL*b)%mod;return (res<0)?res+mod:res;}
int range(int x,int y,int z) {return (x >= y && x <= z);}

struct customCompare {
    bool operator () (int x, int y) {
        return x>y;
    }
};

//=====================================================

int n, m;

int ModExp(int x, int y, int m){
    int res = 1;
    while (y > 0) {
        if (y & 1) res = (res*x) % m;
        y = y>>1;
        x = (x*x) % m;
    }
    return res;
}

int ModInverse(int a, int m) {
    return ModExp(a, m-2, m);
}

int fun (int n, int k) {
    int ans = 0;
    if (k <= n) {
        if (k > n-k) k = n-k;

        ans = 1;
        rep (i, 1, k+1) {
            ans = (ans * ModInverse(i, mod)) % mod;
            ans = (ans * (n - i + 1)) % mod;
        }
    }

    return ans;
}

void solve() {
    int n = nxt();
    int m = nxt();
    
    int sum = 0;
    rep (i, 0, n) {
        sum += nxt();
    }

    cout << fun(m+n, sum+n);
}

int32_t main() {
    ios_base::sync_with_stdio(false); 
    cin.tie(0); cout.tie(0);

    solve();
    return 0;
}