local function getgcd(x, y)
  while 0 < x do
    x, y = y % x, x
  end
  return y
end

local function getlcm(x, y)
  local gcd = getgcd(x, y)
  return (x // gcd) * y
end

local n, m = io.read("*n", "*n")
local a = {}
for i = 1, n do
  a[i] = io.read("*n") // 2
end
local valid = true
local cur = a[1]
for i = 2, n do
  local gcd = getgcd(cur, a[i])
  if (cur // gcd) % 2 == 0 or (a[i] // gcd) % 2 == 0 then
    valid = false
    break
  end
  cur = (cur // gcd) * a[i]
  if m < cur then
    valid = false
    break
  end
end
if valid then
  local c = m // cur
  print(math.ceil(c / 2))
else
  print(0)
end
