#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
ll a[100005];
ll ans;

inline ll gcd(ll x,ll y){
	if(x%y==0) return y;
	else return gcd(y,x%y);
}

int main(){
	int n,m;
	cin>>n>>m;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		a[i]/=2;
	}
	bool f=true;
	ll  lcm=a[1];
	for(int i=2;i<=n;i++){
		lcm = lcm*a[i]/gcd(lcm,a[i]);
		if(lcm>m){
			f=false;
			break;
		}
	}
	if(f==false){
		cout<<"0"<<endl;
		return 0;
	}
	for(int i=1;i<=n;i++){
		if(lcm/a[i]%2==0){
			cout<<"0"<<endl;
			return 0;
		}
	}
	ans=m/lcm;
	ans=(ans+1)/2;
	cout<<ans<<endl;
	return 0;
}