import Data.List main = getContents >>= putStrLn . solve . lines where solve [a, b] | sort a == sort b = "YES" | otherwise = "NO"