/*
　　　　　／＞　 フ
　　　　　| 　_　 _|
　 　　　／`ミ _x 彡
　　 　 /　　　 　 |
　　　 /　  ヽ　　 ?
　／￣|　　 |　|　|
　| (￣ヽ＿_ヽ_)_)
　＼二つ
 */
#pragma GCC optimize("Ofast","inline","-ffast-math")
#pragma GCC target("avx,sse2,sse3,sse4,mmx")
#include<bits/stdc++.h>
#define int long long
#define pb push_back
#define pf push_front
#define F first
#define S second
#define SS stringstream
#define sqr(x) ((x)*(x))
#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define CC(x) cout << (x) << endl
#define AL(x) x.begin(),x.end()
#define pw(x) (1ull<<(x))
#define NMSL cout << "NMSL" << endl;
#define debug(x) cout << #x << ": " << x << endl;
#define debug2(x, y) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl;
#define debug3(x, y, z) cout <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define debug4(a, b, c, d) cout <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define fio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define in128 __int128_t
using namespace std;
const int N = 2e5+10;
const int INF = 0x7f7f7f7f;
const double EPS = 1e-3;
const long double PI = 3.14159265358979323846;
int n,p,ans=0;
int a[55];
map<pair<signed,int>,int>mp;
int DFS(signed x,int rest)
{
    if(mp[{x,rest}])
        return mp[{x,rest}];
    if(x<=0)
        return 1;
    int fake=rest;
    int ck=abs(rest);
    fake%=a[x];
    ck=ck-abs(fake)+a[x];
    mp[{x,rest}]+=DFS(x-1,fake);
    if(ck<a[x+1])
    {
        if(fake>0)
            mp[{x,rest}]+=DFS(x-1,fake-a[x]);
        else if(fake<0)
            mp[{x,rest}]+=DFS(x-1,fake+a[x]);
    }
    return mp[{x,rest}];
}
signed main()
{
    fio
    cin>>n>>p;
    for(int i=0; i<n; ++i)
        cin>>a[i];
    p%=a[n-1];
    ans+=DFS(n-2,p);
    if(p)
        ans+=DFS(n-2,p-a[n-1]);
    cout<<ans;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
 
#define send {ios_base::sync_with_stdio(false);}
#define help {cin.tie(NULL);}
#define f first
#define s second
#define getunique(v) {sort(v.begin(), v.end()); v.erase(unique(v.begin(), v.end()), v.end());}
typedef long long ll;
typedef long double lld;
typedef unsigned long long ull;
 
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v);
template<typename A, typename B> ostream& operator<<(ostream &cout, pair<A, B> const &p) { return cout << "(" << p.f << ", " << p.s << ")"; }
template<typename A> ostream& operator<<(ostream &cout, vector<A> const &v) {
	cout << "["; for(int i = 0; i < v.size(); i++) {if (i) cout << ", "; cout << v[i];} return cout << "]";
}
template<typename A, typename B> istream& operator>>(istream& cin, pair<A, B> &p) {
	cin >> p.first;
	return cin >> p.second;
}
 
mt19937 rng(std::chrono::steady_clock::now().time_since_epoch().count());
// mt19937 rng(61378913);
/* usage - just do rng() */
 
void usaco(string filename) {
  // #pragma message("be careful, freopen may be wrong")
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
 
// #include <atcoder/all>
// using namespace atcoder;
 
const lld pi = 3.14159265358979323846;
const ll mod = 1000000007;
// const ll mod = 998244353;
// ll mod;
 

 
ll n, m, k, q, l, r, x, y, z;
const ll template_array_size = 1e6 + 4191;
ll a[template_array_size];
ll b[template_array_size];
ll c[template_array_size];
string s, t;
ll ans = 0;


 
void nika_orz(int tc = 0) {
	ll x;
	cin >> n >> x;
	
	for (ll i = 0; i < n; i++) cin >> a[i];
	
	ll dp[55][3]; // 0 - less, 1 - equal, 2 - greater
	memset(dp, 0, sizeof(dp));
	dp[0][1] = 1;
	
	ll ans = 0;
	
	for (ll i = 0; i < n; i++) {
		ll val = x;
		if (i < n - 1) val %= a[i + 1];
		ll next_val = 3 * max(x, a[i]);
		if (i < n - 1) next_val = a[i + 1];
		
		ll limit = next_val / a[i];
		
		ll req = val / a[i];
		
		if (req == 0) {
			dp[i + 1][0] += dp[i][0];
			dp[i + 1][1] += dp[i][1];
			dp[i + 1][2] += dp[i][2];
		} else {
			dp[i + 1][0] += dp[i][0];
			
			dp[i + 1][0] += dp[i][1];
			dp[i + 1][1] += dp[i][1];
			
			dp[i + 1][0] += dp[i][2];
			dp[i + 1][2] += dp[i][2];
		}
		
		if (req + 1 < limit) {
			dp[i + 1][2] += dp[i][0];
		}
		
		ll x_req = x / a[i];
		if (x_req < limit) {
			ans += dp[i + 1][2];
			dp[i + 1][2] = 0;
		}
		
		// cout << dp[i + 1][0] << " " << dp[i + 1][1] << " " << dp[i + 1][2] << endl;
	}
	
	cout << ans + 1 << '\n';
}

int main() {
	#ifdef galen_colin_local
		auto begin = std::chrono::high_resolution_clock::now();
	#endif
	
	send help
 
	#ifndef galen_colin_local
		// usaco("cowpatibility");
	#endif
	
	// usaco("cowland");
	
	// freopen("tc.cpp", "r", stdin);
 	
	int tc = 1;
	// cin >> tc;
	for (int t = 0; t < tc; t++) nika_orz(t);
	
	#ifdef galen_colin_local
		auto end = std::chrono::high_resolution_clock::now();
		cout << setprecision(4) << fixed;
		// cout << "Execution time: " << std::chrono::duration_cast<std::chrono::duration<double>>(end - begin).count() << " seconds" << endl;
	#endif
} 