from fractions import gcd

#from math import gcd

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

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

lcm = A[0]

lis = [[0] for _ in range(30)]

tmp = 0

while A[0]%2 == 0:

    A[0]//= 2

    tmp += 1

lis[tmp] = 1



for i in range(1,N):

    tmp = 0

    while A[i]%2 == 0:

        A[i]//= 2

        tmp += 1

    lis[tmp] = 1

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

    if lcm > 2*M:

        print((0))

        exit()

jud = False

for l in lis:

    if l == 1:

        if jud == True:

            print((0))

            exit()

        else:

            jud = True





M -= lcm//2

ans = (M//lcm)+1

print(ans)

from fractions import gcd

#from math import gcd

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

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

lcm = A[0]

lis = [[0] for _ in range(30)]

tmp = 0

while A[0]%2 == 0:

    A[0]//= 2

    tmp += 1

lis[tmp] = 1



for i in range(1,N):

    tmp = 0

    Ai = A[i]

    while Ai%2 == 0:

        Ai//= 2

        tmp += 1

    lis[tmp] = 1

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

    if lcm > 2*M:

        print((0))

        exit()

jud = False

if lis.count(1) > 1:

    print((0))

    exit()





M -= lcm//2

ans = (M//lcm)+1

print(ans)

from fractions import gcd

# from math import gcd
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
lcm = A[0]
lis = [[0] for _ in range(30)]
tmp = 0
while A[0] % 2 == 0:
    A[0] //= 2
    tmp += 1
lis[tmp] = 1
for i in range(1, N):
    tmp = 0
    while A[i] % 2 == 0:
        A[i] //= 2
        tmp += 1
    lis[tmp] = 1
    lcm = (lcm * A[i]) // gcd(lcm, A[i])
    if lcm > 2 * M:
        print((0))
        exit()
jud = False
for l in lis:
    if l == 1:
        if jud == True:
            print((0))
            exit()
        else:
            jud = True
M -= lcm // 2
ans = (M // lcm) + 1
print(ans)

from fractions import gcd

# from math import gcd
N, M = list(map(int, input().split()))
A = list(map(int, input().split()))
lcm = A[0]
lis = [[0] for _ in range(30)]
tmp = 0
while A[0] % 2 == 0:
    A[0] //= 2
    tmp += 1
lis[tmp] = 1
for i in range(1, N):
    tmp = 0
    Ai = A[i]
    while Ai % 2 == 0:
        Ai //= 2
        tmp += 1
    lis[tmp] = 1
    lcm = (lcm * A[i]) // gcd(lcm, A[i])
    if lcm > 2 * M:
        print((0))
        exit()
jud = False
if lis.count(1) > 1:
    print((0))
    exit()
M -= lcm // 2
ans = (M // lcm) + 1
print(ans)

-    while A[i] % 2 == 0: -        A[i] //= 2 +    Ai = A[i] +    while Ai % 2 == 0: +        Ai //= 2 -for l in lis: -    if l == 1: -        if jud == True: -            print((0)) -            exit() -        else: -            jud = True +if lis.count(1) > 1: +    print((0)) +    exit()