#include <bits/stdc++.h>
/*
uint64_t pow64(const uint64_t base, uint64_t index) {
    uint64_t x = 1;
    uint64_t factor = base;

    while(index) {
        if(index & 1) {
            x *= factor;
        }
        factor *= factor;
        index >>= 1;
    }
    return x;
}

std::pair<int64_t, int64_t> extended_gcd(const uint64_t a, const uint64_t b) {
    if(a == 0) {
        return std::make_pair(0, 1);
    }

    const auto p = extended_gcd(b % a, a);

    const auto s = p.first;
    const auto t = p.second;
    const int64_t q = b / a;

    return std::make_pair(t - s * q, s);
}

uint64_t mod_unsigned(const int64_t n, const uint64_t mod) {
    if(n >= 0) {
        return n;
    }

    const auto x = (-n) / mod + 1;
    return n + mod * x;
}


uint64_t mod_inverse(const uint64_t x, const uint64_t mod) {
    return mod_unsigned(extended_gcd(x, mod).first, mod);
}

uint64_t mod_factorial(const uint64_t n, const uint64_t mod) {
    static auto memo = std::vector<uint64_t>(1, 1);

    if(memo.size() > n) {
        return memo[n];
    }

    for(uint64_t i = memo.size(); i <= n; ++i) {
        const auto x = memo[i - 1] * i % mod;
        memo.push_back(x);
    }

    return memo[n];
}

uint64_t mod_factorial_inverse(const uint64_t n, const uint64_t mod) {
    const auto f = mod_factorial(n, mod);
    return mod_inverse(f, mod);
}

uint64_t mod_combination(const uint64_t n, const uint64_t r, const uint64_t mod) {
    const auto a = mod_factorial(n, mod);
    const auto b = mod_factorial_inverse(r, mod);
    const auto c = mod_factorial_inverse(n - r, mod);

    return (a * b % mod) * c % mod;
}

uint64_t mod_pow(uint64_t base, uint64_t index, const uint64_t mod) {
    base %= mod;

    uint64_t x = 1;
    uint64_t factor = base;

    while(index) {
        if(index & 1) {
            x = (x * factor) % mod;
        }
        factor = (factor * factor) % mod;
        index >>= 1;
    }
    return x;
}

int main() {
    uint64_t n;
    std::cin >> n;

    auto cs = std::vector<uint64_t>();
    cs.reserve(n);
    for(uint64_t i = 0; i < n; ++i) {
        uint64_t c;
        std::cin >> c;
        cs.push_back(c);
    }

    const uint64_t mod = pow64(10, 9) + 7;
    const auto mod2n = mod_pow(2, n, mod);

    uint64_t answer = 0;

    for(uint64_t i = 1; i <= n; ++i) {
        uint64_t score = 0;
        for(uint64_t j = 0; j < i; ++j) {
            const auto c = (cs[j] * (i - j)) % mod;
            score = (score + c) % mod;
        }

        score = score * mod_combination(n, i, mod) % mod;
        score = score * mod2n % mod;

        answer = (answer + score) % mod;
    }

    std::cout << answer;

    return 0;
}
*/

uint64_t gcd(const uint64_t a, const uint64_t b) {
    if(a == 0) {
        return b;
    }

    return gcd(b % a, a);
}

int main() {
    uint64_t n, m;
    std::cin >> n >> m;

    auto bs = std::vector<uint64_t>();
    bs.reserve(n);
    for(uint64_t i = 0; i < n; ++i) {
        uint64_t a;
        std::cin >> a;
        bs.push_back(a / 2);
    }

    uint64_t lcm = bs[0];
    bool fail = false;

    for(uint64_t i = 1; i < n; ++i) {
        const auto d = gcd(lcm, bs[i]);
        lcm = lcm / d * bs[i];
        if(lcm > m) {
            fail = true;
            break;
        }
        if(lcm / bs[i] % 2 == 0) {
            fail = true;
            break;
        }
    }

    if(lcm / bs[0] % 2 == 0) {
        fail = true;
    }

    if(fail) {
        std::cout << 0;
    } else {
        std::cout << (m / lcm + 1) / 2;
    }

    return 0;
}


Measured memory_bytes: 1024