import Data.List main = ((\x y -> if sort x == sort y then "YES" else "NO") <$> getLine) <*> getLine >>= putStrLn