module S = Set.Make (struct type t = char let compare x y = Char.code x - Char.code y end) let () = let a, b = Scanf.scanf "%s %s " (fun a b -> a, b) in let rec doit x i l set = if i = l then set else S.add x.[i] set |> doit x (i + 1) l in let s = doit a 0 (String.length a) S.empty in let t = doit b 0 (String.length b) S.empty in print_endline (if S.equal s t then "YES" else "NO")