import sys

read = sys.stdin.buffer.read

from fractions import gcd

from functools import reduce



n,m,*alst = list(map(int,read().split()))

mm=2*m

def lcm(x,y):

  g=gcd(x,y)

  if x//g %2==0 or y//g%2==0:

    return 0

  g=x*y//g

  if g>mm:

    return 0

  return g

f=lambda x,y:0 if x==0 else lcm(x,y)

g=reduce(f,alst)

if g==0:

  print((0))

  quit()

else:

  res=(mm//g)

  print((res//2+res%2))

import sys

read = sys.stdin.buffer.read

from fractions import gcd

from functools import reduce



n, m, *alst = list(map(int, read().split()))

mm = 2 * m





def lcm(x, y):

    g = gcd(x, y)

    if x // g % 2 == 0 or y // g % 2 == 0:

        print((0))

        quit()

    g = x * y // g

    if g > mm:

        print((0))

        quit()

    return g





g = reduce(lcm, alst)

res = (mm // g)

print((res // 2 + res % 2))
import sys

read = sys.stdin.buffer.read
from fractions import gcd
from functools import reduce

n, m, *alst = list(map(int, read().split()))
mm = 2 * m


def lcm(x, y):
    g = gcd(x, y)
    if x // g % 2 == 0 or y // g % 2 == 0:
        return 0
    g = x * y // g
    if g > mm:
        return 0
    return g


f = lambda x, y: 0 if x == 0 else lcm(x, y)
g = reduce(f, alst)
if g == 0:
    print((0))
    quit()
else:
    res = mm // g
    print((res // 2 + res % 2))

import sys

read = sys.stdin.buffer.read
from fractions import gcd
from functools import reduce

n, m, *alst = list(map(int, read().split()))
mm = 2 * m


def lcm(x, y):
    g = gcd(x, y)
    if x // g % 2 == 0 or y // g % 2 == 0:
        print((0))
        quit()
    g = x * y // g
    if g > mm:
        print((0))
        quit()
    return g


g = reduce(lcm, alst)
res = mm // g
print((res // 2 + res % 2))

-        return 0 +        print((0)) +        quit() -        return 0 +        print((0)) +        quit() -f = lambda x, y: 0 if x == 0 else lcm(x, y) -g = reduce(f, alst) -if g == 0: -    print((0)) -    quit() -else: -    res = mm // g -    print((res // 2 + res % 2)) +g = reduce(lcm, alst) +res = mm // g +print((res // 2 + res % 2))