from fractions import gcd

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

a = [int(i) // 2 for i in input().split()]

x = 1

for i in range(n):

    x *= a[i] // gcd(x, a[i])

for i in a:

    if x // i % 2 == 0:

        print((0))

        exit()

print(((m // x + 1) // 2))
from math import gcd, ceil

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

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

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

l = 1

for i in a:

    l *= i // gcd(l, i)

for i in a:

    if l // i % 2 == 0:

        print((0))

        exit()

print((ceil((m // l) / 2)))
from fractions import gcd

n, m = list(map(int, input().split()))
a = [int(i) // 2 for i in input().split()]
x = 1
for i in range(n):
    x *= a[i] // gcd(x, a[i])
for i in a:
    if x // i % 2 == 0:
        print((0))
        exit()
print(((m // x + 1) // 2))

from math import gcd, ceil

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = [i // 2 for i in a]
l = 1
for i in a:
    l *= i // gcd(l, i)
for i in a:
    if l // i % 2 == 0:
        print((0))
        exit()
print((ceil((m // l) / 2)))

-from fractions import gcd +from math import gcd, ceil -a = [int(i) // 2 for i in input().split()] -x = 1 -for i in range(n): -    x *= a[i] // gcd(x, a[i]) +a = list(map(int, input().split())) +a = [i // 2 for i in a] +l = 1 -    if x // i % 2 == 0: +    l *= i // gcd(l, i) +for i in a: +    if l // i % 2 == 0: -print(((m // x + 1) // 2)) +print((ceil((m // l) / 2)))