import Data.Functor( (<$>))

main = do
    s <- getLine
    p@(h:_) <- getLine
    let
	verify 0 _ = False
	verify n str@(c:cs)
	    | and $ zipWith (==) p str	= True
	    | otherwise			= verify (n-1) (cs++[c])

    putStrLn $ if verify (length s) s
		    then "Yes"
		    else "No"

