#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
using P = pair <int,int>; //to, cost
using WeightedGraph = vector<vector <P>>; //to cost
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//https://www.creativ.xyz/dump-cpp-652/
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
 
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

#ifdef DEBUG_
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif
long long gcd(long long a,long long b)
{
    if (a%b==0) return(b);
    else return(gcd(b,a%b));
}
 long long lcm(long long a,long long b){
 long long g = gcd(a,b);
 return a / g * b; 
 }
signed main(void) { cin.tie(0); ios::sync_with_stdio(false);
    int n, m; cin>>n>>m;
    vector <int> a(n);
    rep(i,n) cin>>a[i]; 
    rep(i,n){
        if(a[i]%2 == 1){
            cout<<0<<endl; return 0;
        }
    }
    int cnt = 0;
    rep(i,n){
        a[i]/=2;
    }
    int l = a[0];
    rep(i,n) {l = lcm(l, a[i]); if(l > m) {cout<<0<<endl; return 0;}}
    if(l > m) {cout<<0<<endl; return 0;}
    while(a[0]%2==0) cnt++, a[0]/=2;
    rep(i,n){
        if(i == 0) continue;
        int tmp = 0;
        while(a[i]%2 == 0) tmp++, a[i]/=2;
        if(tmp != cnt) {cout<<0<<endl; return 0;}
    }
    //cout<<l<<endl;
    int ok=-1,ng=1145141919;
    while(abs(ok -ng) > 1){
        //cout<<ok<<' '<<ng<<endl;
        int mid = (ok+ng)/2;
        bool changed = false;
        if(!(mid & 1)) mid += 1, changed = true;
        if(mid * l > m){
            if(changed) mid -=1;
            ng = mid;
        }else{
            if(changed) mid -= 1;
            ok = mid;
        }
    }
    if(ok <= 0) { cout<<0<<endl; return 0;}
    cout<<ok/2 + 1<<endl;
}

Measured memory_bytes: 1024