open Batteries
let () =
  let s,t = Scanf.scanf "%s %s " (fun a b -> a,b) in
  let s_lst = String.to_list s in
  let t_lst = String.to_list t in
  let s_s = List.sort compare s_lst |> String.of_list in
  let t_s = List.sort (fun x y -> compare y x) t_lst |> String.of_list in
  Printf.printf "%s\n" @@
  if s_s < t_s then "Yes" else "No"
