from fractions import gcd

def lcm(arr, n):

    ans = arr[0]

    for i in range(1, n):

        ans = ((arr[i] * ans) // gcd(arr[i], ans))

    return int(ans)



n, m = [int(x) for x in input().split()]

arr = [int(x) for x in input().split()]

v = []

for x in arr:

    y = x

    cnt = 0

    while y % 2 == 0:

        y = y // 2

        cnt += 1

    v.append(cnt)

mx = max(v)

mn = min(v)

if mx != mn:

    print((0))

else:

    strt = lcm(arr, n) // 2

    if strt > m:

        print((0))

    else:

        print((int(1 + int((m - strt)) // int((2 * strt)))))

from fractions import gcd

def lcm(arr, n):

    ans = arr[0]

    for i in range(1, n):

        ans = ((arr[i] * ans) // gcd(arr[i], ans))

    return ans



n, m = [int(x) for x in input().split()]

arr = [int(x) for x in input().split()]

v = []

for x in arr:

    y = x

    cnt = 0

    while y % 2 == 0:

        y = y // 2

        cnt += 1

    v.append(cnt)

mx = max(v)

mn = min(v)

if mx != mn:

    print(0)

else:

    strt = lcm(arr, n) // 2

    if strt > m:

        print(0)

    else:

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

from fractions import gcd


def lcm(arr, n):
    ans = arr[0]
    for i in range(1, n):
        ans = (arr[i] * ans) // gcd(arr[i], ans)
    return int(ans)


n, m = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
v = []
for x in arr:
    y = x
    cnt = 0
    while y % 2 == 0:
        y = y // 2
        cnt += 1
    v.append(cnt)
mx = max(v)
mn = min(v)
if mx != mn:
    print((0))
else:
    strt = lcm(arr, n) // 2
    if strt > m:
        print((0))
    else:
        print((int(1 + int((m - strt)) // int((2 * strt)))))

from fractions import gcd


def lcm(arr, n):
    ans = arr[0]
    for i in range(1, n):
        ans = (arr[i] * ans) // gcd(arr[i], ans)
    return ans


n, m = [int(x) for x in input().split()]
arr = [int(x) for x in input().split()]
v = []
for x in arr:
    y = x
    cnt = 0
    while y % 2 == 0:
        y = y // 2
        cnt += 1
    v.append(cnt)
mx = max(v)
mn = min(v)
if mx != mn:
    print(0)
else:
    strt = lcm(arr, n) // 2
    if strt > m:
        print(0)
    else:
        print(1 + (m - strt) // (2 * strt))

-    return int(ans) +    return ans -    print((0)) +    print(0) -        print((0)) +        print(0) -        print((int(1 + int((m - strt)) // int((2 * strt))))) +        print(1 + (m - strt) // (2 * strt))