#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
using namespace std;

#define SIZE 200000


////////// Mod
#include <iostream>
using namespace std;

class Mod {
public:
  const long MOD = 1000000007;
  //const long MOD = 17;
  const int MaxIntPower = 30;
  Mod(long v = 0) { var = v; }
  void operator = (long r) { var = r; }
  Mod operator + (Mod r) { return (var + r.var) % MOD; }
  Mod operator - (Mod r) { return (var - r.var + MOD) % MOD; }
  Mod operator * (Mod r) { return (var * r.var) % MOD; }
  Mod operator / (Mod r) { return (var * r.Reverse().var) % MOD; }

  void operator += (Mod r) { var = (var + r.var) % MOD; }
  void operator -= (Mod r) { var = (var - r.var + MOD) % MOD; }
  void operator *= (Mod r) { var = (var * r.var) % MOD; }
  void operator /= (Mod r) { var = (var * r.Reverse().var) % MOD; }

  bool operator ==(const Mod& r) { return var == r.var; }
  bool operator <(const Mod& r) { return var < r.var; }
  bool operator !=(const Mod& r) { return var != r.var; }

  Mod Power(int p) {
    if (var == 0 || var == 1) return var;
    while (p < 0) p += MOD - 1;
    p = p % (MOD - 1);
    long bit = 1 << MaxIntPower;
    Mod ans = 1;
    while (bit >= 1) {
      ans *= ans;
      if ((bit & p) != 0)
        ans *= var;
      bit = (bit >> 1);
    }
    return ans;
  }

  Mod Reverse() {
    long a = var;
    long b = MOD;
    long u = 1;
    long v = 0;
    while (b > 0) {
      long t = a / b;
      a -= t * b;
      swap(a, b);
      u -= t * v;
      swap(u, v);
    }

    Mod val;
    val.var = (u + MOD) % MOD;
    return val;
  }
  long var;
};

int main()
{
  long n, m;
  long a[2000];
  cin >> n >> m;
  long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  sum += n;
  Mod bunbo = 1;
  Mod bunshi = 1;

  for (int i = 0; i < sum; i++) {
    bunshi *= m + n - i;
    bunbo *= i + 1;
  }
  Mod ans = bunshi/bunbo;
  cout << ans.var;
}
/*
Written By mafailure
*/
#define ill
//In the name of God
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file 
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> // for less
using namespace std;
using namespace __gnu_pbds;
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define endl "\n"
#ifdef ill
#define int long long 
#endif
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void dbg_out() { cerr << endl; }
template<typename Head, typename... Tail> void dbg_out(Head H, Tail... T) { cerr << ' ' << H; dbg_out(T...); }
 
#ifdef AATIF_DEBUG
#define dbg(...) cerr << "(" << #__VA_ARGS__ << "):", dbg_out(__VA_ARGS__)
#else
#define dbg(...)
#endif
//#define int long long 
// int dx[]={-1,1,0,0}; int dy[]={0,0,1,-1};
// int dx[]={2,2,-2,-2,1,1,-1,-1}; int dy[]={1,-1,1,-1,2,-2,2,-2};
const long long mod = 1e9 + 7;
const double eps=1e-9;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> ii;
typedef vector< pair< int, int > > vii;
typedef map<int, int> mii;
typedef pair<int, ii> pip;
typedef pair<ii, int> ppi;
#define arrinp(arr,init,final,size,type) type* arr=new type[size];for(int i=init;i<final;i++)cin>>arr[i];
#define cr2d(arr,n,m,t) t**arr=new t*[n];for(int i=0;i<n;i++)arr[i]=new t[m];
#define w(t) int t;cin>>t; while(t--)
#define takeInp(n) int n;cin>>n;
#define fr(i,init,final) for(int i=init;i<final;i++)
#define frr(i,init,final) for(int i=init;i>=final;i--)
#define Fr(i,final) for(int i=0;i<final;i++)
#define Frr(i,first) for(int i=first;i>=0;i--)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define debug(x) cerr<<">value ("<<#x<<") : "<<x<<endl;
#define setb __builtin_popcount
#define lsone(n) (n&(-n))
#define rlsone(n) (n&(n-1))
#define clr(a,b) memset(a,b,sizeof(a))
const int inf= INT_MAX;
//struct point_i{int x,y;};
struct point_i{int x,y;
point_i(){ x=0; y=0;}
point_i(int x_,int y_){x=(x_);y=(y_) ;}
};

struct point 
{
	float x,y;
	point (){x=y=0.0;}
	point (float x_,float y_){x=(x_); y=(y_);}
	bool operator < (point other) const{
	  if(fabs(x-other.x)>eps)return x<other.x;
	  return y<other.y;
		
		}
	bool operator == (point other) const {
		return fabs(other.x-x)<=eps&& fabs(other.y-y)<=eps;
		}
	
} ;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>  ordered_set; 
vi init(string s)
{
	istringstream sin(s);
	int n;
	vi arr;
	while(sin>>n)arr.push_back(n);
	return arr;
}
int power(int x, int y)
{ 
	if(y==0)return 1;
	int u=power(x,y/2);
	u=(u*u)%mod;
	if(y%2)u=(x*u)%mod;
	return u;
    
}
int gcd(int a,int b)
{
	if(a<b)return gcd(b,a);
	return (b==0?a:(a%b?gcd(b,a%b):b));
}
int gcd_e(int a,int b,int &x,int &y)
{
	
	if(b==0){x=1; y=0; return a;}
	int x1,y1;
	int p=gcd_e(b,a%b,x1,y1);
	x=y1;
	y=x1-(a/b)*y1;
	return p;
}

int mul(int a,int b)
{
	return (a*b)%mod; 
}
int inv(int n)
{
	return power(n,mod-2);
}

signed main()
{
	IOS
	int n; cin>>n; 
	int m; cin>>m; 
	
	vi a(n);             
	fr(i,0,n) cin>>a[i];
	int sum=accumulate(all(a),n); 
	int num=1; 
	int den=1; 
	m+=n;
	fr(i,0,sum)
	{
		num=mul(num,m-i); 
		den=mul(den,sum-i);
	}
	cout<<mul(num,inv(den))<<endl;
	//fr(i,0,n) sum+=a[i]; 
	
	
	
	 
	
	
}
