#include <bits/stdc++.h>
 
#define ll long long
using namespace std;
#define MOD 1000000007


ll powmod(ll a, ll p) {
    //cout<<a<<" "<<p<<endl;
    if(p==0) return 1;
    if(p%2) return (powmod(a,p-1)*a)%MOD;
    ll z = powmod(a,p/2);
    return (z*z)%MOD;
}
ll inv(ll a) {
    return powmod(a%MOD,MOD-2);
}

void solve()
{
    int N, M;
    cin>>N>>M;
    vector<int> A(N);
    for(auto &a: A) cin>>a;
    ll s = 0;
    for(auto &a: A) s+=a;
    
    if(s>M) {
        cout<<0<<endl;
        return;
    }
    
    ll n = M-s;
    ll k = s+N+1;
    ll ans = 1;
    for(int i=1; i<k; ++i) {
        ans = (ans*(n+i))%MOD;
        ans = (ans*inv(i))%MOD;
    }
    cout<<ans<<endl;

}
 
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    solve();
 
		
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll N, X;
vector<ll> A(60, 0);
const ll M = 100000;
ll memo[60][M] = {};

ll cnt(ll index, ll zan) {
  if (zan < M && memo[index][zan] > 0) return memo[index][zan];
  if (index == 0) return 1;
  if (zan == 0) return 1;
  ll temp = zan / A[index];
  ll zan1 = zan - A[index] * temp;
  ll zan2 = abs(zan - A[index] * (temp + 1));

  ll ans;
  if (temp == 0 && index != N - 1) ans = cnt(index - 1, zan1);
  else if (zan1 == 0) ans = cnt(index - 1, zan2);
  else if (zan2 == 0) ans = cnt(index - 1, zan1);
  else ans = cnt(index - 1, zan1) + cnt(index - 1, zan2);
  if (zan < M) memo[index][zan] = ans;
  return ans;
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  cin >> N;
  cin >> X;
  for (ll i = 0; i < N; i++) {
    cin >> A[i];
  }
  ll ans = cnt(N - 1, X);
  cout << ans << '\n';
  return 0;
}