import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto nm = readln.split.to!(long[]);
    auto N = nm[0];
    auto M = nm[1];
    auto as = readln.split.to!(long[]);
    auto x = as[0];
    foreach (a; as[1..$]) {
        x = x * a / gcd(x, a);
        if (x <= 0) {
            writeln(0);
            return;
        }
    }
    writeln((M*2/x+1)/2);
}