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

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



def gcd(x, y):

    return x if y == 0 else gcd(y, x % y)

def lcm(x, y):

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



k = 1



for i in l:

    i //= 2

    k = lcm(k, i)

    if (k // i) % 2 == 0 or k > m:

        print((0))

        break

else:

    print((m // k - m // (k * 2)))
f=lambda:list(map(int,input().split()))

n,m=f()

l=list(f())

def g(x,y):

  while y: x,y=y,x%y

  return x

k=1

for i in l:

  i//=2; k=k*i//g(k,i)

  if (k//i)%2<1 or k>m: print((0)); break

else:

  print((m//k-m//(k*2)))
n, m = list(map(int, input().split()))
l = list(map(int, input().split()))


def gcd(x, y):
    return x if y == 0 else gcd(y, x % y)


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


k = 1
for i in l:
    i //= 2
    k = lcm(k, i)
    if (k // i) % 2 == 0 or k > m:
        print((0))
        break
else:
    print((m // k - m // (k * 2)))

f = lambda: list(map(int, input().split()))
n, m = f()
l = list(f())


def g(x, y):
    while y:
        x, y = y, x % y
    return x


k = 1
for i in l:
    i //= 2
    k = k * i // g(k, i)
    if (k // i) % 2 < 1 or k > m:
        print((0))
        break
else:
    print((m // k - m // (k * 2)))

-n, m = list(map(int, input().split())) -l = list(map(int, input().split())) +f = lambda: list(map(int, input().split())) +n, m = f() +l = list(f()) -def gcd(x, y): -    return x if y == 0 else gcd(y, x % y) - - -def lcm(x, y): -    return (x * y) // gcd(x, y) +def g(x, y): +    while y: +        x, y = y, x % y +    return x -    k = lcm(k, i) -    if (k // i) % 2 == 0 or k > m: +    k = k * i // g(k, i) +    if (k // i) % 2 < 1 or k > m: