import Control.Applicative
import Control.Monad

data YesNo = Yes | No deriving(Show)

solver :: String -> String -> Int -> YesNo
solver s t n
    | n == 0    = No
    | s == t    = Yes
    | otherwise = solver (tail s ++ [head s]) t (n-1)

main :: IO ()
main = do
    s <- getLine
    t <- getLine
    print $ solver s t (length t)
