import Control.Monad
import Data.List

main :: IO ()
main = replicateM 2 getLine >>= putStrLn . solve 

solve :: [String] -> String
solve [ss, ts]
    | match "" ss = "Yes"
    | otherwise = "No"
    where
        match xs yys@(y : ys)
            | reverse xs `isSuffixOf` ts && yys `isPrefixOf` ts = True
            | otherwise = match (y : xs) ys
        match _ _ = False