import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, core.stdc.stdio;

void main() {
    auto s = readln.split.map!(to!int);
    auto N = s[0];
    auto M = s[1].to!long;
    auto A = readln.split.map!(to!long).array;

    long lcm(long a, long b) {
        return a * b / gcd(a, b);
    }

    auto x = A.front / 2;

    foreach (i; 1..N) {
        x = lcm(x, A[i] / 2);
        if (x > M) {
            writeln(0);
            return;
        }
    }

    writeln(x % 2 == 0 ? 0 : M / x / 2 + x % 2);
}