import Control.Monad (replicateM)
import Data.List (sort)

main = replicateM 2 getLine >>= putStrLn . f . map sort where
    f [a, b] = if a == b then "YES" else "NO"