import Data.List main = do x <- getLine y <- getLine putStrLn $ if sort x == sort y then "YES" else "NO"