import fractions

import math

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

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

s = set(a)

c = set()

l = 1

k = (a[0] // 2) % 2

for i in a:

    l = l * i // fractions.gcd(l,i)

    if l // 2 > m:

        ans = 0

        break

    count = 0

    while True:

        if (i>>count) % 2 == 0:

            count += 1

        else:

            c.add(count)

            break

    if len(c) > 1:

        ans = 0

        break

else:

    ans = (m + l // 2) // l



print(ans)
import fractions

import math

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

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

a = set(a)

c = set()

l = 1

for i in a:

    l = l * i // fractions.gcd(l,i)

    if l // 2 > m:

        ans = 0

        break

    count = 0

    while True:

        if (i>>count) % 2 == 0:

            count += 1

        else:

            c.add(count)

            break

    if len(c) > 1:

        ans = 0

        break

else:

    ans = (m + l // 2) // l



print(ans)
import fractions
import math

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
s = set(a)
c = set()
l = 1
k = (a[0] // 2) % 2
for i in a:
    l = l * i // fractions.gcd(l, i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i >> count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l
print(ans)

import fractions
import math

n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
a = set(a)
c = set()
l = 1
for i in a:
    l = l * i // fractions.gcd(l, i)
    if l // 2 > m:
        ans = 0
        break
    count = 0
    while True:
        if (i >> count) % 2 == 0:
            count += 1
        else:
            c.add(count)
            break
    if len(c) > 1:
        ans = 0
        break
else:
    ans = (m + l // 2) // l
print(ans)

-s = set(a) +a = set(a) -k = (a[0] // 2) % 2