import sys

readline = sys.stdin.buffer.readline

from fractions import gcd

from functools import reduce



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

alst = list(map(int,readline().split()))



def lcm(x,y):

  g=gcd(x,y)

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

    return 0

  return x*y//g

g=reduce(lcm,alst)

if g==0:

  print((0))

  quit()

else:

  res=(2*m//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

g=reduce(lcm,alst)

if g==0:

  print((0))

  quit()

else:

  res=(mm//g)

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

import sys

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

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


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


g = reduce(lcm, alst)
if g == 0:
    print((0))
    quit()
else:
    res = 2 * m // 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


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

-readline = sys.stdin.buffer.readline +read = sys.stdin.buffer.read -n, m = list(map(int, readline().split())) -alst = list(map(int, readline().split())) +n, m, *alst = list(map(int, read().split())) +mm = 2 * m -    return x * y // g +    g = x * y // g +    if g > mm: +        return 0 +    return g -    res = 2 * m // g +    res = mm // g