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

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



from math import floor

from fractions import gcd

from functools import reduce





def lcm(x, y):

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





b = [n // 2 for n in a]



lcm_b = reduce(lcm, b)



for n in b:

    if (lcm_b // n) % 2 == 0:

        print((0))

        exit()



n = floor((M / lcm_b - 1) / 2) + 1



print(n)

import sys

from fractions import gcd

from functools import reduce



read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines

sys.setrecursionlimit(10 ** 9)

INF = 1 << 60





def lcm(x, y):

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





def main():

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

    A = [a // 2 for a in A]



    semi_lcm = reduce(lcm, A)

    for a in A[1:]:

        semi_lcm = lcm(semi_lcm, a)

        if semi_lcm > M or semi_lcm // a % 2 == 0:

            print((0))

            return



    print(((M // semi_lcm + 1) // 2))

    return





if __name__ == '__main__':

    main()

N, M = list(map(int, input().split()))
a = list(map(int, input().split()))
from math import floor
from fractions import gcd
from functools import reduce


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


b = [n // 2 for n in a]
lcm_b = reduce(lcm, b)
for n in b:
    if (lcm_b // n) % 2 == 0:
        print((0))
        exit()
n = floor((M / lcm_b - 1) / 2) + 1
print(n)

import sys
from fractions import gcd
from functools import reduce

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10**9)
INF = 1 << 60


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


def main():
    N, M, *A = list(map(int, read().split()))
    A = [a // 2 for a in A]
    semi_lcm = reduce(lcm, A)
    for a in A[1:]:
        semi_lcm = lcm(semi_lcm, a)
        if semi_lcm > M or semi_lcm // a % 2 == 0:
            print((0))
            return
    print(((M // semi_lcm + 1) // 2))
    return


if __name__ == "__main__":
    main()

-N, M = list(map(int, input().split())) -a = list(map(int, input().split())) -from math import floor +import sys + +read = sys.stdin.read +readline = sys.stdin.readline +readlines = sys.stdin.readlines +sys.setrecursionlimit(10**9) +INF = 1 << 60 -b = [n // 2 for n in a] -lcm_b = reduce(lcm, b) -for n in b: -    if (lcm_b // n) % 2 == 0: -        print((0)) -        exit() -n = floor((M / lcm_b - 1) / 2) + 1 -print(n) +def main(): +    N, M, *A = list(map(int, read().split())) +    A = [a // 2 for a in A] +    semi_lcm = reduce(lcm, A) +    for a in A[1:]: +        semi_lcm = lcm(semi_lcm, a) +        if semi_lcm > M or semi_lcm // a % 2 == 0: +            print((0)) +            return +    print(((M // semi_lcm + 1) // 2)) +    return + + +if __name__ == "__main__": +    main()