main=do
    s1<-getLine
    s2<-getLine
    ana (length s1) s1 s2

ana :: Int->String->String->IO()
ana 0 _ _ = putStrLn "No"
ana a x y = do
    if x==y
    then putStrLn "Yes"
    else ana (a-1) x ((last y):(init y))
