import Data.List (sort) f True = "YES" f _ = "NO" main = do l1 <- sort <$> getLine l2 <- sort <$> getLine putStrLn . f $ l1 == l2