module Main where

import Control.Applicative
import Control.Monad
import Data.List

main :: IO ()
main = do
    [a, b, c] <- getLine
    [e, f, g] <- getLine
    let ps = [ a == g
            , b == f
            , c == e
            ]
    if and ps
        then putStrLn "YES"
        else putStrLn "NO"