import Control.Applicative ((<$>), (<*>))
import Data.List (tails, inits)
import Data.Bool (bool)

main :: IO ()
main = solve <$> getLine <*> getLine >>= putStrLn

solve :: String -> String -> String
solve s t = bool "No" "Yes" . elem t . (zipWith (++) <$> tails <*> inits) $ s
