from collections import Counter,defaultdict,deque

from heapq import heappop,heappush,heapify

import sys,bisect,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

mod2 = 998244353

INF = float('inf')

def inp(): return int(sys.stdin.readline())

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

def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))



def f(x):

    cnt = 0

    while x%2==0:

        cnt += 1

        x //= 2

    return cnt



n,m = inpl()

a = inpl()

g = f(a[0])

xx = a[0]



for i in range(1,n):

    if g != f(a[i]):

        print((0))

        quit()

    xx = xx*a[i]//fractions.gcd(xx,a[i])

if xx//2 > m:

    print((0))

else:

    print(((m*2-xx)//(xx*2)+1))



from collections import Counter,defaultdict,deque

from heapq import heappop,heappush

from bisect import bisect_left,bisect_right 

import sys,math,itertools,fractions,pprint

sys.setrecursionlimit(10**8)

mod = 10**9+7

INF = float('inf')

def inp(): return int(sys.stdin.readline())

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



def f(x):

    cnt = 0

    while x%2 == 0:

        cnt += 1

        x //= 2

    return cnt

def lcm(x,y):

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



n,m = inpl()

a = inpl()

a = list(set(a))

c = list(set([f(x) for x in a]))

if len(c) != 1:

    print((0))

    quit()

c = c[0]

x = 1

for i in range(len(a)):

    x = lcm(a[i]//2, x)

# print(x)

print(((m+x)//(2*x)))
from collections import Counter, defaultdict, deque
from heapq import heappop, heappush, heapify
import sys, bisect, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
mod2 = 998244353
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


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


def inpln(n):
    return list(int(sys.stdin.readline()) for i in range(n))


def f(x):
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x //= 2
    return cnt


n, m = inpl()
a = inpl()
g = f(a[0])
xx = a[0]
for i in range(1, n):
    if g != f(a[i]):
        print((0))
        quit()
    xx = xx * a[i] // fractions.gcd(xx, a[i])
if xx // 2 > m:
    print((0))
else:
    print(((m * 2 - xx) // (xx * 2) + 1))

from collections import Counter, defaultdict, deque
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
import sys, math, itertools, fractions, pprint

sys.setrecursionlimit(10**8)
mod = 10**9 + 7
INF = float("inf")


def inp():
    return int(sys.stdin.readline())


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


def f(x):
    cnt = 0
    while x % 2 == 0:
        cnt += 1
        x //= 2
    return cnt


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


n, m = inpl()
a = inpl()
a = list(set(a))
c = list(set([f(x) for x in a]))
if len(c) != 1:
    print((0))
    quit()
c = c[0]
x = 1
for i in range(len(a)):
    x = lcm(a[i] // 2, x)
# print(x)
print(((m + x) // (2 * x)))

-from heapq import heappop, heappush, heapify -import sys, bisect, math, itertools, fractions, pprint +from heapq import heappop, heappush +from bisect import bisect_left, bisect_right +import sys, math, itertools, fractions, pprint -mod2 = 998244353 -def inpln(n): -    return list(int(sys.stdin.readline()) for i in range(n)) - - +def lcm(x, y): +    return x * y // math.gcd(x, y) + + -g = f(a[0]) -xx = a[0] -for i in range(1, n): -    if g != f(a[i]): -        print((0)) -        quit() -    xx = xx * a[i] // fractions.gcd(xx, a[i]) -if xx // 2 > m: +a = list(set(a)) +c = list(set([f(x) for x in a])) +if len(c) != 1: -else: -    print(((m * 2 - xx) // (xx * 2) + 1)) +    quit() +c = c[0] +x = 1 +for i in range(len(a)): +    x = lcm(a[i] // 2, x) +# print(x) +print(((m + x) // (2 * x)))