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

void main()
{
    auto nm = readln.split.to!(int[]);
    auto N = nm[0];
    auto M = nm[1];

    long x = 1;
    foreach (a; readln.split.to!(long[])) {
        auto y = x / gcd(x, a/2) * (a/2);
        if (y < 0 || M < y) {
            writeln(0);
            return;
        }
        x = y;
    }
    writeln((M - x) / (x*2) + 1);
}