import fractions





def lcm(a, b):

    return a * b // fractions.gcd(a, b)





def div_count_by_2(x):

    count = 0

    while x % 2 == 0:

        count += 1

        x //= 2



    return count





n, m = list(map(int, input().split()))

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



num = A[0]

count = div_count_by_2(num)

for a in A:

    if count == div_count_by_2(a):

        continue

    else:

        print((0))

        exit()



x = A[0]//2

for a in A:

    x = lcm(x, a//2)



ans = m//x - m//(2*x)

print(ans)
from math import gcd

from functools import reduce

import sys

input = sys.stdin.readline





def lcm(a, b):

    return a*b // gcd(a, b)





def count_factor_2(num):

    count = 0

    while num % 2 == 0:

        num //= 2

        count += 1

    return count





def main():

    n, m = list(map(int, input().split()))

    A = list([int(x)//2 for x in input().split()])



    check = len(set(map(count_factor_2, A)))

    if check != 1:

        print((0))

        return



    lcm_a = reduce(lcm, A)

    step = lcm_a * 2

    ans = (m + lcm_a) // step

    print(ans)





if __name__ == "__main__":

    main()

import fractions


def lcm(a, b):
    return a * b // fractions.gcd(a, b)


def div_count_by_2(x):
    count = 0
    while x % 2 == 0:
        count += 1
        x //= 2
    return count


n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
num = A[0]
count = div_count_by_2(num)
for a in A:
    if count == div_count_by_2(a):
        continue
    else:
        print((0))
        exit()
x = A[0] // 2
for a in A:
    x = lcm(x, a // 2)
ans = m // x - m // (2 * x)
print(ans)

from math import gcd
from functools import reduce
import sys

input = sys.stdin.readline


def lcm(a, b):
    return a * b // gcd(a, b)


def count_factor_2(num):
    count = 0
    while num % 2 == 0:
        num //= 2
        count += 1
    return count


def main():
    n, m = list(map(int, input().split()))
    A = list([int(x) // 2 for x in input().split()])
    check = len(set(map(count_factor_2, A)))
    if check != 1:
        print((0))
        return
    lcm_a = reduce(lcm, A)
    step = lcm_a * 2
    ans = (m + lcm_a) // step
    print(ans)


if __name__ == "__main__":
    main()

-import fractions +from math import gcd +from functools import reduce +import sys + +input = sys.stdin.readline -    return a * b // fractions.gcd(a, b) +    return a * b // gcd(a, b) -def div_count_by_2(x): +def count_factor_2(num): -    while x % 2 == 0: +    while num % 2 == 0: +        num //= 2 -        x //= 2 -n, m = list(map(int, input().split())) -A = list(map(int, input().split())) -num = A[0] -count = div_count_by_2(num) -for a in A: -    if count == div_count_by_2(a): -        continue -    else: +def main(): +    n, m = list(map(int, input().split())) +    A = list([int(x) // 2 for x in input().split()]) +    check = len(set(map(count_factor_2, A))) +    if check != 1: -        exit() -x = A[0] // 2 -for a in A: -    x = lcm(x, a // 2) -ans = m // x - m // (2 * x) -print(ans) +        return +    lcm_a = reduce(lcm, A) +    step = lcm_a * 2 +    ans = (m + lcm_a) // step +    print(ans) + + +if __name__ == "__main__": +    main()