#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 2e3 + 10;
const ll mod = 1e9 + 7;

ll n, m, a[N];

ll ksm(ll a, ll p)
{
	ll res = 1;
	while (p)
	{
		if (p & 1) res = res * a % mod;
		a = a * a % mod;
		p >>= 1;
	}
	return res;
}

ll get_c(ll n, ll m)
{
	ll res = 1;
	for (ll i = 1; i <= m; i++)
		res = res * (n - i + 1) % mod * ksm(i, mod - 2) % mod;
	return res;
}

int main()
{
	scanf("%lld %lld", &n, &m);
	for (int i = 1; i <= n; i++)
		scanf("%lld", &a[i]);
	
	ll sum = 0;
	for (int i = 1; i <= n; i++)
		sum += a[i];
	
	printf("%lld\n", get_c(m + n, sum + n));
	
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
template<class T> ostream& operator<<(ostream &os, vector<T> V) { os << "[ "; 
  for(auto v:V)os << v << " "; return os << "]";
}
template<class T> ostream& operator<<(ostream &os, set<T> S){ os << "{ "; 
  for(auto s:S) os<<s<<" ";  return os<<"}"; 
}
template<class L, class R> ostream& operator<<(ostream &os, pair<L,R> P) {
  return os<<"("<<P.first<<","<< P.second << ")";
}
template<class L, class R> ostream& operator<<(ostream &os, map<L,R> M) {
  os<<"{ ";for(auto m:M)os<<"("<<m.first<<":"<<m.second<<")";
  return os<<"}";
}
#define cerr cout
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...) 1
#endif
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// find_by_order(k)  returns iterator to kth element starting from 0;
// order_of_key(k) returns count of elements strictly smaller than k;
//For multiset use less_equal operator but it does support erase operations for multiset
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define I insert 
#define pb push_back
#define F first
#define S second
#define endl "\n"
#define all(v) (v).begin(),(v).end()
#define For(i,n) for(int i=0;i<(int)n;++i)
#define Rev(i,n) for(int i=(int)n-1;i>=0;--i)
#define Rep(i,n) for(int i=1;i<=(int)n;++i)
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define mp make_pair
// inline void modadd(int &a,int &b){a+=b;if(a>=mod)a-=mod;} 
const int mod = 1e9+7;
inline int add(int a, int b){
  a += b;
  if(a >= mod)
    a -= mod;
  return a;
}
inline int mul(int a,int b){
  return a*1ll*b%mod;
}


int power(int a, int b){
  int res = 1;
  while(b){
    if(b&1)
      res = mul(res , a);
    a = mul(a ,a);
    b >>= 1;
  }
  return res;
}

const int N = 4e6 + 100;

int A[N];

int main(){
  fio; cout<<fixed<<setprecision(25);	
  int n , m;
  cin >> n >> m;
  int sm = 0;
  for(int i =1 ;i <= n ; ++i){
    cin >> A[i];
    sm += A[i];
  }
  //cout << sm << endl;
  if(sm > m)
    cout << 0 << endl;
  else{
    m -= sm;
    //we want sum as m
    int num = 1;
    int den = 1;
    for(int i = 0;i < sm+n ; ++i){
      den = mul(den , i+1);
      num = mul(num , m-i+sm+n);
    }
    //cout << num << ' ' << den << endl;
    cout << mul(num, power(den , mod-2)) << endl;
  }

  return 0;
}
