open System

let rec gcd x y =
    if y = 0L then x
    else gcd y (x % y)
let readInts () = stdin.ReadLine().Split(' ') |> Array.map int64
let uncurry f (a,b) = f a b
let any = Array.fold (||) false
let all = Array.fold (||) true

let lcm x y = x * y / gcd x y
let rec div x =
    if x >= 1L && x % 2L = 0L then 1L + div (x/2L)
    else 0L

let args = readInts()
let n, m = int args.[0], args.[1]
let a = readInts() |> Array.map (fun i -> i/2L)
let b = Array.map div a
if all (Array.map (fun i -> i=b.[0]) b) then printfn "0"
else
    let c = Array.fold lcm 1L a
    printfn "%d" ((m/c+1L)/2L)