import Data.List main :: IO () main = do a <- getLine :: IO String b <- getLine :: IO String putStrLn $ if sort a == sort b then "YES" else "NO"