import copy

import fractions

import sys

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

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

a=copy.copy(A[0])

c=0

while a%2==0:

  a=a//2

  c=c+1

d=2**c

for i in range(n):

  if A[i]//d!=float(A[i])/d or A[i]//(2*d)==float(A[i])/(2*d):

    print((0))

    sys.exit()

B=[]

for i in range(n):

  B.append(A[i]//2)

b=1

for i in range(n):

  b=b*B[i]//fractions.gcd(b,B[i])

  if b>m:

    print((0))

    sys.exit()

if b>m:

  print((0))

else:

  print((1+(m-b)//(2*b)))
import sys

import fractions as f

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

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

a=A[0]

b=0

while a%2==0:

  a=a//2

  b=b+1

b=2**b

B=[0]*n

for i in range(n):

  B[i]=A[i]//b

  if B[i]*b!=A[i] or B[i]%2==0:

    print((0))

    sys.exit()

G=1

for i in range(n):

  G=G*B[i]//(f.gcd(G,B[i]))

print((int((m+G*b//2))//(G*b)))
import copy
import fractions
import sys

n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
a = copy.copy(A[0])
c = 0
while a % 2 == 0:
    a = a // 2
    c = c + 1
d = 2**c
for i in range(n):
    if A[i] // d != float(A[i]) / d or A[i] // (2 * d) == float(A[i]) / (2 * d):
        print((0))
        sys.exit()
B = []
for i in range(n):
    B.append(A[i] // 2)
b = 1
for i in range(n):
    b = b * B[i] // fractions.gcd(b, B[i])
    if b > m:
        print((0))
        sys.exit()
if b > m:
    print((0))
else:
    print((1 + (m - b) // (2 * b)))

import sys
import fractions as f

n, m = list(map(int, input().split()))
A = list(map(int, input().split()))
a = A[0]
b = 0
while a % 2 == 0:
    a = a // 2
    b = b + 1
b = 2**b
B = [0] * n
for i in range(n):
    B[i] = A[i] // b
    if B[i] * b != A[i] or B[i] % 2 == 0:
        print((0))
        sys.exit()
G = 1
for i in range(n):
    G = G * B[i] // (f.gcd(G, B[i]))
print((int((m + G * b // 2)) // (G * b)))

-import copy -import fractions +import fractions as f -a = copy.copy(A[0]) -c = 0 +a = A[0] +b = 0 -    c = c + 1 -d = 2**c +    b = b + 1 +b = 2**b +B = [0] * n -    if A[i] // d != float(A[i]) / d or A[i] // (2 * d) == float(A[i]) / (2 * d): +    B[i] = A[i] // b +    if B[i] * b != A[i] or B[i] % 2 == 0: -B = [] +G = 1 -    B.append(A[i] // 2) -b = 1 -for i in range(n): -    b = b * B[i] // fractions.gcd(b, B[i]) -    if b > m: -        print((0)) -        sys.exit() -if b > m: -    print((0)) -else: -    print((1 + (m - b) // (2 * b))) +    G = G * B[i] // (f.gcd(G, B[i])) +print((int((m + G * b // 2)) // (G * b)))