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