import Control.Monad import Data.List main = do [a,b] <- replicateM 2 getLine putStrLn $ if (sort a) == (sort b) then "YES" else "NO"