swap' :: [a] -> [a]
swap' [] = []
swap' (x:xs) = swap' xs ++ [x]

equiv :: Eq a => [a] -> [a] -> Bool
equiv [] [] = True
equiv _ [] = False
equiv [] _ = False
equiv (x:xs) (y:ys) = (x == y) && equiv xs ys

main :: IO()
main = do
  fstLine <- getLine
  sndLine <- getLine
  if equiv fstLine (swap' sndLine)
    then putStr "YES\n"
    else putStr "NO\n"
