#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define debug cerr << "-- " << __LINE__ << " --" << endl
#define MOD 1000000007
#define ALL(o) (o).begin(), (o).end()
typedef long long int ll;

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template <typename T> string to_string(const vector<T> &xs) {string s="["; for(int i=0;i<xs.size();i++) s += (i>0 ? " " : "") + to_string(xs[i]); return s + "]";}
template <typename T> ll argmax(const T &xs) {return distance(xs.begin(), max_element(xs.begin(), xs.end()));}
template <typename T> ll argmin(const T &xs) {return distance(xs.begin(), min_element(xs.begin(), xs.end()));}
ll nextLL(){ll x; scanf("%lld", &x); return x;}
int nextInt(){int x; scanf("%d", &x); return x;}
string nextString(){string s; cin >> s; return s;}


ll extgcd(ll a, ll b, ll &x, ll &y) {
    /* g を返す時点で ax + by == g となる */
    ll g = a; x = 1; y = 0;
    if (b != 0) g = extgcd(b, a % b, y, x), y -= (a / b) * x;
    return g;
}
ll gcd(ll a, ll b) { ll x, y; return extgcd(a, b, x, y); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

ll remainder(ll x, ll y) {assert(y > 0); ll r = x % y; if (r < 0) r += y; return r;}
ll quotient(ll x, ll y) {assert(y > 0); return (x - remainder(x, y)) / y;}

class llm{
	ll n;
public:
	llm(){n = 0;}
	llm(ll n){this->n = (n >= 0) ? (n % MOD) : (MOD - 1 - (-n-1 % MOD));}
	operator ll() const {return n;}
	llm operator+(const llm &y) const{ return llm((ll)*this + (ll)y);}
	llm operator+=(const llm &y) { *this = *this + y; return *this;}
	llm operator-(const llm &y) const{ return llm((ll)*this - (ll)y);}
	llm operator-=(const llm &y) { *this = *this - y; return *this;}
	llm operator-() const{ return llm(0) - *this;}
	llm operator*(const llm &y) const{ return llm((ll)*this * (ll)y);}
	llm operator*=(const llm &y) { *this = *this * y; return *this;}
	llm operator/(const llm &y) const{ return *this * y.inv();}
	llm operator/=(const llm &y) { *this = *this / y; return *this;}
	llm inv() const{
		ll x, y;
		if (extgcd(n, MOD, x, y) == 1) return llm(x);
  		return llm(0); // unsolvable
	}
	friend istream& operator >> (istream& os, llm& x);
	friend ostream& operator << (ostream& os, const llm& x);
};
istream& operator >> (istream& is, llm& x){ll n; is >> n; x = llm(n); return is;}
ostream& operator << (ostream& os, const llm& x){os << (ll)x; return os;}

template<typename T> T comb(ll n, ll k){
	T ret = 1;
	for(ll i=1;i<=k;i++) ret = ret * T(n - k + i) / T(i);
	return ret;
}



pair<ll, ll> CRT(vector<pair<ll, ll>> rms){
	/* Chinese Remainder Theorem (extended to non-coprime)
		[(3, 4), (5, 6)] => (11, 12)
		[(2, 4), (5, 6)] => (0, -1) : no solution case
	*/
	assert(!rms.empty());
	for(int i=0;i+1<rms.size();i++){
		/* find r[i] (mod m[i]) and r[i+1] (mod m[i+1]) */
		ll x, y;
		ll g = extgcd(rms[i].second, rms[i+1].second, x, y);
		/* m[i] * x + m[i+1] * y = g 
			=> m[i+1] * y    is    g (mod m[i])    and    0 (mod m[i+1])    -- (a)
			   m[i] * x      is    0 (mod m[i])    and    g (mod m[i+1])    -- (b)
			   1             is    1 (mod m[i])    and    1 (mod m[i+1])    -- (c)
		*/
		if (rms[i].first % g != rms[i+1].first % g) return make_pair(0, -1);
		ll a = rms[i].first / g, b = rms[i+1].first / g, c = rms[i].first % g;
		ll lc = rms[i].second / g * rms[i+1].second;
		ll r =	(rms[i+1].second * y % lc * a % lc + rms[i].second * x % lc * b % lc + c) % lc;
		if (r < 0) r += lc;
		rms[i+1] = make_pair(r, lc);
	}
	return rms[rms.size()-1];
}


ll n, m;
vector<ll> a;

int main(void){
	cin >> n >> m;
	for(ll i=0;i<n;i++) a.pb(nextLL());

	vector<pair<ll, ll>> rms;
	for(ll i=0;i<n;i++) rms.pb(mp(a[i]/2, a[i]));
	
	auto rm = CRT(rms);

	ll ans = 0;
	if (rm.second >= 0 && m >= rm.first){
		ans = (m - rm.first) / rm.second + 1;
	}

	cout << ans << endl;

    return 0;
}




Measured memory_bytes: 4336