#include<iostream>
using namespace std;
long long gcd(long long x,long long y){return y?gcd(y,x%y):x;}
long long lcm(long long x,long long y){return x/gcd(x,y)*y;}
int main(){
    long long n,m,num=1LL,tmp;
    cin>>n>>m;
    long long a[n];
    for(int i=0;i<n;i++){
        cin>>a[i];
        if((a[i]&-a[i])!=(a[0]&-a[0])){cout<<0<<endl;return 0;}
    }
    for(auto &x:a)x/=2;
    for(int i=0;i<n;i++){
        tmp=lcm(num,a[i]);
        if((tmp/a[i])%2LL==1LL)num=tmp;
    }
    if(m<num)cout<<0<<endl;
    else cout<<(m-num)/(num*2LL)+1LL<<endl;
    return 0;
}