from sys import exit

from fractions import gcd



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

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



a = A[0]

n = 1

while a % 2 == 0:

    n *= 2

    a //= 2



lcm = 1

for a in A:

    if a % n != 0 or a % (2 * n) == 0:

        print((0))

        exit()

    lcm = lcm * a // gcd(lcm, a)

    if lcm // 2 > M:

        print((0))

        exit()



print(((M - lcm // 2) // lcm + 1))

def main():

    from fractions import gcd



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

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



    a = A[0]

    n = 1

    while a & 1 == 0:

        n <<= 1

        a >>= 1



    lcm = 1

    for a in A:

        if a % n != 0 or a % (2 * n) == 0:

            print((0))

            return

        lcm = lcm * a // gcd(lcm, a)

        if lcm > M * 2:

            print((0))

            return



    print(((M - lcm // 2) // lcm + 1))





main()

from sys import exit
from fractions import gcd

N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
a = A[0]
n = 1
while a % 2 == 0:
    n *= 2
    a //= 2
lcm = 1
for a in A:
    if a % n != 0 or a % (2 * n) == 0:
        print((0))
        exit()
    lcm = lcm * a // gcd(lcm, a)
    if lcm // 2 > M:
        print((0))
        exit()
print(((M - lcm // 2) // lcm + 1))

def main():
    from fractions import gcd

    N, M = list(map(int, input().split()))
    A = list(map(int, input().split()))
    a = A[0]
    n = 1
    while a & 1 == 0:
        n <<= 1
        a >>= 1
    lcm = 1
    for a in A:
        if a % n != 0 or a % (2 * n) == 0:
            print((0))
            return
        lcm = lcm * a // gcd(lcm, a)
        if lcm > M * 2:
            print((0))
            return
    print(((M - lcm // 2) // lcm + 1))


main()

-from sys import exit -from fractions import gcd +def main(): +    from fractions import gcd -N, M = list(map(int, input().split())) -A = list(map(int, input().split())) -a = A[0] -n = 1 -while a % 2 == 0: -    n *= 2 -    a //= 2 -lcm = 1 -for a in A: -    if a % n != 0 or a % (2 * n) == 0: -        print((0)) -        exit() -    lcm = lcm * a // gcd(lcm, a) -    if lcm // 2 > M: -        print((0)) -        exit() -print(((M - lcm // 2) // lcm + 1)) +    N, M = list(map(int, input().split())) +    A = list(map(int, input().split())) +    a = A[0] +    n = 1 +    while a & 1 == 0: +        n <<= 1 +        a >>= 1 +    lcm = 1 +    for a in A: +        if a % n != 0 or a % (2 * n) == 0: +            print((0)) +            return +        lcm = lcm * a // gcd(lcm, a) +        if lcm > M * 2: +            print((0)) +            return +    print(((M - lcm // 2) // lcm + 1)) + + +main()