from fractions import gcd

from functools import reduce



def lcm(x, y):

    return x * y // gcd(x, y)



def lcm_list(numbers):

    return reduce(lcm, numbers, 1)



def sub_by_2(n):

    cnt = 0

    while n % 2 == 0:

        cnt += 1

        n //= 2

    return cnt



N, M = list(map(int, input().split()))

A = list(map(int, input().split()))



lcm_2 = [sub_by_2(v // 2) for v in A]

if all(lcm_2[0] == v for v in lcm_2):

    num = lcm_list([v // 2 for v in A])

    ans = M // num

    print((ans // 2 + ans % 2))

else:

    print((0))

from functools import reduce

from fractions import gcd



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



def lcm(x, y):

    return x * y // gcd(x, y)



def sub_by_2(n):

    cnt = 0

    while n % 2 == 0:

        n //= 2

        cnt += 1

    return cnt



lcm_2 = [sub_by_2(n // 2) for n in A]

if all(lcm_2[0] == v for v in lcm_2):

    num = reduce(lcm, [v // 2 for v in A])

    res = M // num

    print((res // 2 + res % 2))

else:

    print((0))

from fractions import gcd
from functools import reduce


def lcm(x, y):
    return x * y // gcd(x, y)


def lcm_list(numbers):
    return reduce(lcm, numbers, 1)


def sub_by_2(n):
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    return cnt


N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
lcm_2 = [sub_by_2(v // 2) for v in A]
if all(lcm_2[0] == v for v in lcm_2):
    num = lcm_list([v // 2 for v in A])
    ans = M // num
    print((ans // 2 + ans % 2))
else:
    print((0))

from functools import reduce
from fractions import gcd

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


def lcm(x, y):
    return x * y // gcd(x, y)


def sub_by_2(n):
    cnt = 0
    while n % 2 == 0:
        n //= 2
        cnt += 1
    return cnt


lcm_2 = [sub_by_2(n // 2) for n in A]
if all(lcm_2[0] == v for v in lcm_2):
    num = reduce(lcm, [v // 2 for v in A])
    res = M // num
    print((res // 2 + res % 2))
else:
    print((0))

+from functools import reduce -from functools import reduce + +N, M, *A = list(map(int, open(0).read().split())) -def lcm_list(numbers): -    return reduce(lcm, numbers, 1) - - +        n //= 2 -        n //= 2 -N, M = list(map(int, input().split())) -A = list(map(int, input().split())) -lcm_2 = [sub_by_2(v // 2) for v in A] +lcm_2 = [sub_by_2(n // 2) for n in A] -    num = lcm_list([v // 2 for v in A]) -    ans = M // num -    print((ans // 2 + ans % 2)) +    num = reduce(lcm, [v // 2 for v in A]) +    res = M // num +    print((res // 2 + res % 2))