main = do
  [a1, b1, c1] <- map return <$> getLine
  [a2, b2, c2] <- map return <$> getLine
  putStrLn $ solved a1 b1 c1 a2 b2 c2

solved:: String -> String -> String -> String -> String -> String -> String
solved a1 b1 c1 a2 b2 c2
  | a1 == c2 && b1 == b2 && c1 == a2 = "YES"
  | otherwise = "NO"
  