import qualified Data.List (sort) main = getContents >>= (\[a, b] -> putStrLn $ f a b) . lines where f a b = if Data.List.sort a == Data.List.sort b then "YES" else "NO"