#include<bits/stdc++.h>
            #define ll long long
            #define f   first
            #define s   second
            #define pb          push_back
            #define mod        1000000007
            #define mod1       1000000009
            #define hell        998244353
            #define inf         1000000000000000000LL
            #define pi          3.14159265358979323
            //#define N           100005 
            const int N=100005;
            using namespace std;
            ll n,k,sum,q,res,m,val,ans;
            ll x,y;
            ll xx[]={1,0,-1,0};
            ll yy[]={0,1,0,-1};
            bool spf[N];
            void solve()    
            {   ll a,b;
                for(int i=1;i<N;i++) spf[i]=1;
                for(int i=4;i<N;i+=2) spf[i]=0;
                for(int i=3;i*i<N;i+=2)
                {   if(spf[i]){
                    for(int j=2*i;j<N;j+=i)
                        if(spf[j]) spf[j]=0;
                }
                }
                vector<ll> primes;
                for(int i=3;i<N;i+=2) if(spf[i]) primes.pb(i);
                cin>>n>>m;
                map<ll,ll> hm;
                //cout<<primes.size();
                set<ll> s,s1;
                for(int i=0;i<n;i++)
                {
                    cin>>x;

                    if(s.find(x)!=s.end()) continue;
                    s.insert(x);
                    x/=2;
                    ll c1=0;
                    while(x%2==0) {x/=2;c1++;}
                    s1.insert(c1);
                    for(auto y:primes)
                    {   
                        ll c=0;
                        if(x==1) break;
                        if(x%y) continue;
                        while(x%y==0)
                        {
                            c++;
                            x/=y;
                        }
                        hm[y]=max(hm[y],c);   
                    }
                    if(x>1)
                        hm[x]=1;

                }
                if(n==1 and m==1) {cout<<1;return;}
                //cout<<s.size()<<" ";
                if(s1.size()>1) {cout<<"0";return;}
                if(s1.size()==1) hm[2]=*s1.begin();
                //for(auto x:s) cout<<x<<" ";
                unsigned long long res=1;
                for(auto x:hm)
                {
                    y=x.f;
                    ll z=x.s;
                    while(z--)
                    {
                        if(res>m)
                        {
                            cout<<"0";return;
                        }
                        res*=y;
                    }
                    if(res>m)
                        {
                            cout<<"0";return;
                        }
                }
                //cout<<res<<" ";
                ll ans=0;
                for(int i=1;i<m;i+=2)
                {
                    if((res*i)>m) break;
                    else ans++;
                }
                cout<<ans;


            }
            int main()
            {   ios_base::sync_with_stdio(false);
                cin.tie(0);cout.tie(0);
                ll t=1;
                //cin>>t;
                while(t--)
                    solve();
                

            }            

Measured memory_bytes: 3948