import Data.List f :: String -> String -> String f l1 l2 = if sort l1 == sort l2 then "YES" else "NO" main = (f <$> getLine) <*> getLine >>= putStrLn