import Data.List main::IO() main = do xa<-getLine xb<-getLine let hantei xa xb = (sort xa) `compare` (sort xb) putStrLn (if hantei xa xb ==EQ then "YES" else "NO")