rotstr :: String -> String 
rotstr str = (last str) : (init str)

isIn :: String -> String -> Bool
isIn s t = elem t $ take (length s) $ iterate rotstr s  

main = do
  s <- getLine 
  t <- getLine 
  if (isIn s t) then print "Yes" else print "No" 
