import Data.List

solve :: String -> String -> String
solve s p = if isInfixOf p s || check (slen - 1) then "Yes" else "No"
    where
        slen = length s
        plen = length p
        check l
            | l <= 0    = False
            | otherwise = if (take l p) == (drop (slen - l) s) && (drop l p) == (take (plen - l) s) then True else check (l - 1)

main :: IO ()
main = do
    s <- getLine
    p <- getLine
    putStrLn $ solve s p