let rec gcd n m =
  if m = 0 then n
  else gcd m (n mod m)

let lcm n m = n / gcd n m * m

(*
X / (0.5 * a_k) = (2 * p + 1)
*)

let () = Scanf.scanf "%d %d\n" @@ fun n m ->
  let as_ = Array.init n @@ fun _ -> Scanf.scanf "%d " @@ fun a -> a / 2 in
  Printf.printf "%d\n" @@
  try
    let lcm = Array.fold_left (fun ans a ->
      (if m < ans then raise Not_found);
      lcm ans a) 1 as_ in
    if
      Array.fold_left ( || ) false @@
      Array.init n @@ fun i -> lcm / as_.(i) mod 2 = 0
    then 0
    else (m / lcm + 1) / 2
  with Not_found -> 0

