from fractions import gcd



def lcm(a,b):

  return a*b//gcd(a,b)



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

A = [int(i) for i in input().split()]



a = 0

b = A[0]

while b % 2 == 0:

  a += 1

  b = b//2

  

for i in range(1,N):

  if A[i] % (2**a) != 0 or A[i] % (2**(a+1)) == 0:

    print((0))

    exit()



c = A[0]

for i in range(N-1):

  c = lcm(c,A[i+1])



print(((M+c//2)//c))
import sys

from math import gcd

sys.setrecursionlimit(10**7)

def I(): return int(sys.stdin.readline().rstrip())

def MI(): return list(map(int,sys.stdin.readline().rstrip().split()))

def LI(): return list(map(int,sys.stdin.readline().rstrip().split()))  #空白あり

def LI2(): return list(map(int,sys.stdin.readline().rstrip()))  #空白なし

def S(): return sys.stdin.readline().rstrip()

def LS(): return list(sys.stdin.readline().rstrip().split())  #空白あり

def LS2(): return list(sys.stdin.readline().rstrip())  #空白なし





N,M = MI()

A = LI()



x = sum(a % 2 == 0 for a in A)

if x != N:

    print((0))

    exit()



r = 0

while A[0] % 2 == 0:

    r += 1

    A[0] //= 2

for i in range(1,N):

    if A[i] % (2**r) != 0 or (A[i]//(2**r)) % 2 == 0:

        print((0))

        exit()

    else:

        A[i] //= 2**r



lcm = A[0]

for i in range(1,N):

    lcm = (lcm*A[i])//gcd(lcm,A[i])



a = (lcm*2**r)//2

print((((M//a)+1)//2))

from fractions import gcd


def lcm(a, b):
    return a * b // gcd(a, b)


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

import sys
from math import gcd

sys.setrecursionlimit(10**7)


def I():
    return int(sys.stdin.readline().rstrip())


def MI():
    return list(map(int, sys.stdin.readline().rstrip().split()))


def LI():
    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり


def LI2():
    return list(map(int, sys.stdin.readline().rstrip()))  # 空白なし


def S():
    return sys.stdin.readline().rstrip()


def LS():
    return list(sys.stdin.readline().rstrip().split())  # 空白あり


def LS2():
    return list(sys.stdin.readline().rstrip())  # 空白なし


N, M = MI()
A = LI()
x = sum(a % 2 == 0 for a in A)
if x != N:
    print((0))
    exit()
r = 0
while A[0] % 2 == 0:
    r += 1
    A[0] //= 2
for i in range(1, N):
    if A[i] % (2**r) != 0 or (A[i] // (2**r)) % 2 == 0:
        print((0))
        exit()
    else:
        A[i] //= 2**r
lcm = A[0]
for i in range(1, N):
    lcm = (lcm * A[i]) // gcd(lcm, A[i])
a = (lcm * 2**r) // 2
print((((M // a) + 1) // 2))

-from fractions import gcd +import sys +from math import gcd + +sys.setrecursionlimit(10**7) -def lcm(a, b): -    return a * b // gcd(a, b) +def I(): +    return int(sys.stdin.readline().rstrip()) -N, M = list(map(int, input().split())) -A = [int(i) for i in input().split()] -a = 0 -b = A[0] -while b % 2 == 0: -    a += 1 -    b = b // 2 +def MI(): +    return list(map(int, sys.stdin.readline().rstrip().split())) + + +def LI(): +    return list(map(int, sys.stdin.readline().rstrip().split()))  # 空白あり + + +def LI2(): +    return list(map(int, sys.stdin.readline().rstrip()))  # 空白なし + + +def S(): +    return sys.stdin.readline().rstrip() + + +def LS(): +    return list(sys.stdin.readline().rstrip().split())  # 空白あり + + +def LS2(): +    return list(sys.stdin.readline().rstrip())  # 空白なし + + +N, M = MI() +A = LI() +x = sum(a % 2 == 0 for a in A) +if x != N: +    print((0)) +    exit() +r = 0 +while A[0] % 2 == 0: +    r += 1 +    A[0] //= 2 -    if A[i] % (2**a) != 0 or A[i] % (2 ** (a + 1)) == 0: +    if A[i] % (2**r) != 0 or (A[i] // (2**r)) % 2 == 0: -c = A[0] -for i in range(N - 1): -    c = lcm(c, A[i + 1]) -print(((M + c // 2) // c)) +    else: +        A[i] //= 2**r +lcm = A[0] +for i in range(1, N): +    lcm = (lcm * A[i]) // gcd(lcm, A[i]) +a = (lcm * 2**r) // 2 +print((((M // a) + 1) // 2))