from fractions import gcd

from functools import reduce



N, M, *A = list(map(int, open(0).read().split()))



Y = reduce(lambda a, b: a * b // gcd(a, b), A)



print((M // (Y // 2) - (M // Y) if all((Y // a) % 2 for a in A) else 0))
from fractions import gcd



lcm = lambda a, b: a * b // gcd(a, b)



N, M, *A = list(map(int, open(0).read().split()))



Y = A[0]

for a in A[1:]:

    Y = lcm(Y, a)

    if Y > 2 * M:

        print((0))

        quit()



print((M // (Y // 2) - (M // Y) if all((Y // a) % 2 for a in A) else 0))
from fractions import gcd
from functools import reduce

N, M, *A = list(map(int, open(0).read().split()))
Y = reduce(lambda a, b: a * b // gcd(a, b), A)
print((M // (Y // 2) - (M // Y) if all((Y // a) % 2 for a in A) else 0))

from fractions import gcd

lcm = lambda a, b: a * b // gcd(a, b)
N, M, *A = list(map(int, open(0).read().split()))
Y = A[0]
for a in A[1:]:
    Y = lcm(Y, a)
    if Y > 2 * M:
        print((0))
        quit()
print((M // (Y // 2) - (M // Y) if all((Y // a) % 2 for a in A) else 0))

-from functools import reduce +lcm = lambda a, b: a * b // gcd(a, b) -Y = reduce(lambda a, b: a * b // gcd(a, b), A) +Y = A[0] +for a in A[1:]: +    Y = lcm(Y, a) +    if Y > 2 * M: +        print((0)) +        quit()