let () =
    let rec gcd a b = if b = 0 then a else gcd b (a mod b) in
    let lcm a b = a / gcd a b * b in
    let main () =
        let n, m = Scanf.scanf "%d %d" (fun n m -> n, m) in
        let a = Array.init n (fun _ -> Scanf.scanf " %d" (fun p -> p)) in
        let rec loop i acc =
            if i = n then acc else
                loop (i + 1) (lcm acc (a.(i) / 2))
        in
        let l = loop 1 (a.(0) / 2) in
        let r = if Array.fold_left (fun t k -> t || ((l / (k / 2)) mod 2 = 0)) false a then 0 else (m / l + 1) / 2 in
        Printf.printf "%d\n" r
    in
    main ()