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

#define rep(i,n) for(int (i)=0; (i)<(int)(n); (i)++)
#define frep(i,m,n) for(int (i)=(m); (i)<(int)(n); (i)++)
#define rrep(i,n) for(int (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(int (i)=(n)-1; (i)>(int)(m)-1; (i)--)
#define all(x) (x).begin(), (x).end()
#define sqr(x) (x)*(x)
#define CEIL(a,b) ((a)+(b)-1) /(b)

typedef long long ll;
const int INF = 1001001001;
const int MOD = 1000000007;

// A:array of pair, N:size of array
void sort_second(vector<pair<ll, ll>> &A, int N);
// a^n
ll a_n(ll a, ll n);
// make vector of (n!)%MOD, (n!)^(-1)%MOD to calculate nCk
void nCk(vector<ll> &n, vector<ll> &ninv);
// a^(-1) % MOD 
ll inv(ll a);
// map of prime factorization
void prime_map(map<int, int> &a, int n);
// get gcd from prime map
ll gcd_map(map<int, int> a, map<int, int> b);
// get lcm from prime map
ll lcm_map(map<int, int> a, map<int, int> b);
// get gcd
ll my_gcd(ll a, ll b);

int main() {
    int n, m;
    cin >> n >> m;
    int a[101010];
    rep(i, n) cin >> a[i];

    int div_two = 0, temp = a[0];
    while(temp%2 == 0) {
        temp /= 2;
        div_two++;
    }
    frep(i, 1, n) {
        int count = 0;
        temp = a[i];
        while(temp%2 == 0) {
            temp /= 2;
            count++;
        }
        if(div_two != count) {
            cout << 0 << endl;
            return 0;
        }
    }
    rep(i, n) a[i] /= 2;
    
    map<int, int> T;
    prime_map(T, a[0]);

    frep(i, 1, n) {
        map<int, int> new_a;
        prime_map(new_a, a[i]);
        for(auto p: new_a) {
            auto key = p.first;
            auto value = p.second;
            if(T.count(key) && T.at(key) < value) {
                T.at(key) = value;
            }
            else if(!(T.count(key))) T[key] = value;
        }
    }
    ll LCM = 1;
    for(auto p: T) {
        auto key = p.first;
        auto value = p.second;
        LCM *= a_n(key, value);
    }
    int ans;
    if((m/LCM)%2 == 0) ans = (m/LCM)/2;
    else ans = ((m/LCM)+1)/2;

    cout << ans << endl;

    return 0;
}

void sort_second(vector<pair<ll, ll>> &A, int N) {
    rep(i, N) swap(A.at(i).first, A.at(i).second);
    sort(all(A));
    rep(i, N) swap(A.at(i).first, A.at(i).second);
}
ll a_n(ll a, ll n) { 
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        ret %= MOD;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count))%MOD ;
}

/* calculate a^n with no recursive process (%MOD)
ll a_n(ll a, ll n) { 
    ll ret = a, count = 1;
    int num = 1;
    vector<ll> memory(100);
    memory.at(0) = a;

    while(count * 2 < n) {
        ret *= ret;
        ret %= MOD;
        count *= 2;
        memory.at(num) = ret;
        num++;
    }
    if(count == n) return ret;
    else {
        bitset<100> bit = bitset<100>(n-count);
        rep(i, 100) {
            if(bit.test(i)) ret = (ret * memory.at(i)) % MOD;
        }
        return ret;
    }    
}
*/

void nCk(vector<ll> &n, vector<ll> &ninv) {
    n[0] = 1;
    for(int i = 1; i < n.size(); i++) n[i] = (n[i-1] * i) % MOD;
    ninv[n.size()-1] = inv(n[n.size()-1]);
    for(int i = n.size() - 2; i > -1; i--) ninv[i] = (ninv[i+1] * (i+1)) % MOD;
}

ll inv(ll a) {
    return a_n(a, MOD-2);
}

void prime_map(map<int, int> &a, int n) {
    while((n%2) == 0) {
        n /= 2;
        if(a.count(2)) a.at(2)++;
        else a[2] = 1;
    }
    for(int i = 3; i*i <= n; i+=2) {
        while((n%i) == 0) {
            n /= i;
            if(a.count(i)) a.at(i)++;
            else a[i] = 1;
        }
    }
    if(n != 1) a[n] = 1;
}

ll gcd_map(map<int, int> a, map<int, int> b) {
    ll ret = 1;
    for(auto p : a) {
        auto key = p.first;
        auto value = p.second;
        if(b.count(key)) {
            if(value > b.at(key)) ret *= a_n(key, b.at(key));
            else ret *= a_n(key, value);
        }
    }
    return ret;
}

ll lcm_map(map<int, int> a, map<int, int> b) {
    ll ret = 1;
    for(auto p: a) {
        auto key = p.first;
        auto value = p.second;
        if(b.count(key)) {
            if(value > b.at(key)) ret *= a_n(key, value);
            else ret *= a_n(key, b.at(key));
        }
        else {
            ret *= a_n(key, value);
        }
    }
    for(auto p: b) {
        auto key = p.first;
        auto value = p.second;
        if(a.count(key)) {
            continue;
        }
        else {
            ret *= a_n(key, value);
        }
    }
    return ret;
}

ll my_gcd(ll a, ll b) {
    if(b == 0) return a;
    return my_gcd(b, a%b);
}

Measured memory_bytes: 640