import Data.Bool (bool)
import qualified Data.ByteString as B

main :: IO ()
main = putStr
  =<< solve <$> B.getLine <*> B.getLine

solve :: B.ByteString -> B.ByteString -> String
solve s t = bool "No" "Yes"
  $ s `B.isInfixOf`
  $ B.concat [t, t]
  
