f :: String -> String -> Bool
f s t = maximum $ map (== s) $ h $ take (length s) $ repeat t
  where
    g (x:xs) = xs ++ [x]
    h [] = []
    h (y:ys) = y : map g (h ys)

main = do
  s <- getLine
  t <- getLine
  putStrLn $ if f s t then "Yes" else "No"
