#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
ll I=167167167167167167;
ll Q=1e9+7;

int main(){
	ll N,X;
	cin>>N>>X;
	vector<ll> p(N);
	vector<ll> high(N);
	vector<ll> low(N);
	for(int i=0;i<N;i++){
		cin>>p[i];
		high[i]=((X-1)/p[i]+1)*p[i];
		low[i]=(X/p[i])*p[i];
	}
	vector<ll> dp1(N);
	auto dp2=dp1;
	dp1[0]=1;
	for(int i=0;i<N-1;i++){
		dp1[i+1]=dp1[i];
		dp2[i+1]=dp2[i];
		if((high[i+1]-low[i])%p[i+1]!=0) dp2[i+1]+=dp1[i];
		if((high[i]-low[i+1])%p[i+1]!=0) dp1[i+1]+=dp2[i];
	}
	cout<<dp1[N-1]+dp2[N-1]<<endl;
}
#include <bits/stdc++.h>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define FOR(i,n,m) for(int i=(int)(n); i<=(int)(m); i++)
#define RFOR(i,n,m) for(int i=(int)(n); i>=(int)(m); i--)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define ins insert

#define debug(a) cerr<<(a)<<endl
#define dbrep(a,n) rep(_i,n) cerr<<(a[_i])<<" "; cerr<<endl
#define dbrep2(a,n,m) rep(_i,n){rep(_j,m) cerr<<(a[_i][_j])<<" "; cerr<<endl;}

using namespace std;

template<class A, class B>
ostream &operator<<(ostream &os, const pair<A,B> &p){return os<<"("<<p.fi<<","<<p.se<<")";}
template<class A, class B>
istream &operator>>(istream &is, pair<A,B> &p){return is>>p.fi>>p.se;}

/* Some Libraries */

//-------------------------------------------------

const int N_MAX = 50;
ll dp[N_MAX][2];

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; ll X; cin>>N>>X;
    vll a(N);
    rep(i,N) cin>>a[i];

    if (N==1){
        cout<<"1\n";
        return 0;
    }

    vll cnt(N);
    ll now = X;
    RFOR(i,N-1,0){
        cnt[i]+=now/a[i];
        now%=a[i];
    }
    vll r(N-1);
    rep(i,N-1) r[i] = a[i+1]/a[i];

    dp[0][0] = 1;
    rep(i,N-1)rep(j,2){
        if (dp[i][j]==0) continue;
        ll t = cnt[i]+j;
        if (t%r[i]==0){
            dp[i+1][(t==r[i])] += dp[i][j];
        }else{
            dp[i+1][0] += dp[i][j];
            dp[i+1][1] += dp[i][j];
        }
    }
    cout<<dp[N-1][0]+dp[N-1][1]<<"\n";
    return 0;
}
