import Control.Monad
import Data.List
import Data.Maybe
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = do
    s <- getLine
    t <- getLine
    putStrLn . (\b -> if b then "Yes" else "No") $ any (\i -> let
        s' = drop i s ++ take i s
        in s' == t
        ) [0..length s]
