#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

int main() {
	ll n, m, mcd = 0, mcm = 1;
	ll ans;
	vector <ll> a;
	cin >> n >> m;
	a.resize(n);
	//sort();
	for(int i = 0; i < n; i++) {
		cin >> a[i];
		mcd = __gcd(mcd, a[i]);
	}
	for(int i = 0; i < n; i++) {
		a[i] /= mcd;
		if (a[i] % 2 == 0) {
			printf("%d\n", 0);
			return 0;
		}
	}
	mcm = a[0];
	for(int i = 1; i < n; i++) {
		mcm = a[i] * mcm / __gcd(a[i], mcm);
		if (mcm > 2 * m / mcd) {
			printf("%d\n", 0);
			return 0;
		}
		
	}
	
	ans = (2ll * m / (1ll * mcm * mcd) + 1) / 2;
	printf("%lld\n", ans);
	return 0;
}