from math import gcd

from functools import reduce

def lcm_base(x, y):

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

def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)

def evencount(n):

  cnt=0

  while n%2==0:

    cnt+=1

    n//=2

  return cnt

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

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

for i in range(n):

  a[i]//=2

if all(evencount(i) == evencount(a[0]) for i in a):

  d=lcm(*a)

  print(((m+d)//2//d))

else:print((0))
from math import gcd

from functools import reduce 

def lcm_base(x, y):

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

def lcm(*numbers):

    return reduce(lcm_base, numbers, 1)

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

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

for i in range(n):

  a[i]//=2

b=lcm(*a)

if b>m:

  print((0))

  exit()

i=a[0]

j=0

cnt=0

while (i>>j)&1==0:

  j+=1

  cnt+=1

for i in a[1:]:

  j=0

  ans=0

  while (i>>j)&1==0:

    j+=1

    ans+=1

  if ans!=cnt:

    print((0))

    break

else:print(((m+b)//(2*b)))

    
from math import gcd
from functools import reduce


def lcm_base(x, y):
    return (x * y) // gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


def evencount(n):
    cnt = 0
    while n % 2 == 0:
        cnt += 1
        n //= 2
    return cnt


n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(n):
    a[i] //= 2
if all(evencount(i) == evencount(a[0]) for i in a):
    d = lcm(*a)
    print(((m + d) // 2 // d))
else:
    print((0))

from math import gcd
from functools import reduce


def lcm_base(x, y):
    return (x * y) // gcd(x, y)


def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)


n, m = list(map(int, input().split()))
a = list(map(int, input().split()))
for i in range(n):
    a[i] //= 2
b = lcm(*a)
if b > m:
    print((0))
    exit()
i = a[0]
j = 0
cnt = 0
while (i >> j) & 1 == 0:
    j += 1
    cnt += 1
for i in a[1:]:
    j = 0
    ans = 0
    while (i >> j) & 1 == 0:
        j += 1
        ans += 1
    if ans != cnt:
        print((0))
        break
else:
    print(((m + b) // (2 * b)))

-def evencount(n): -    cnt = 0 -    while n % 2 == 0: -        cnt += 1 -        n //= 2 -    return cnt - - -if all(evencount(i) == evencount(a[0]) for i in a): -    d = lcm(*a) -    print(((m + d) // 2 // d)) +b = lcm(*a) +if b > m: +    print((0)) +    exit() +i = a[0] +j = 0 +cnt = 0 +while (i >> j) & 1 == 0: +    j += 1 +    cnt += 1 +for i in a[1:]: +    j = 0 +    ans = 0 +    while (i >> j) & 1 == 0: +        j += 1 +        ans += 1 +    if ans != cnt: +        print((0)) +        break -    print((0)) +    print(((m + b) // (2 * b)))