let () = Scanf.scanf "%d %d" @@ fun n m ->
  Printf.printf "%d\n" @@
  if n <= 1 then m
  else Array.fold_left (List.fold_left max) 1 @@
    Array.init m @@ fun i ->
      if 0 < m mod (i + 1) || m / (i + 1) < n
      then []
      else [i + 1]
