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;

    auto g = A.map!(a => a / 2).reduce!gcd;

    long x = 1;
    auto B = A.map!(a => a / 2).array.sort().uniq.array;

    foreach (a; B) {
        x *= a / g;
        if (x > M) {
            writeln(0);
            return;
        }
    }

    writeln(M / x / 2 + x % 2);
}