from fractions import gcd

def lcm(p,q):

    return p*q//gcd(p,q)

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

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

x = 1

for i in range(n):

    a[i] = a[i]//2

    x = lcm(x,a[i])

for i in range(n):

    if (x//a[i])%2==0:

        print((0))

        exit()

p = m//x

print((p//2 if p%2==0 else p//2+1))
from fractions import gcd

def lcm(p,q):

    return p*q//gcd(p,q)

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

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

x = 1

for i in range(N):

  x = lcm(x, a[i])

for i in range(N):

  if (x//a[i])%2==0:

    print((0))

    exit()

num = M//x

print((num//2 if num%2==0 else num//2+1))

from fractions import gcd


def lcm(p, q):
    return p * q // gcd(p, q)


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

from fractions import gcd


def lcm(p, q):
    return p * q // gcd(p, q)


N, M = list(map(int, input().split()))
a = [int(i) // 2 for i in input().split()]
x = 1
for i in range(N):
    x = lcm(x, a[i])
for i in range(N):
    if (x // a[i]) % 2 == 0:
        print((0))
        exit()
num = M // x
print((num // 2 if num % 2 == 0 else num // 2 + 1))

-n, m = list(map(int, input().split())) -a = list(map(int, input().split())) +N, M = list(map(int, input().split())) +a = [int(i) // 2 for i in input().split()] -for i in range(n): -    a[i] = a[i] // 2 +for i in range(N): -for i in range(n): +for i in range(N): -p = m // x -print((p // 2 if p % 2 == 0 else p // 2 + 1)) +num = M // x +print((num // 2 if num % 2 == 0 else num // 2 + 1))