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 lcm x y =
    x * y / gcd x y
let any = Array.fold (||) false

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