Scanf.scanf "%s %s" (fun a b -> let make_his s = let n = String.length s in let h = Array.make 26 0 in for i = 0 to n - 1 do let c = int_of_char s.[i] - 97 in h.(c) <- h.(c) + 1 done; h in print_endline @@ if make_his a = make_his b then "YES" else "NO" )