let () =
  Scanf.scanf "%s %s" @@ fun s t ->
  let ss = s ^ s in
  Array.init (String.length s) (fun i -> String.sub ss i (String.length t) = t)
  |> Array.fold_left (||) false
  |> fun b -> print_endline (if b then "Yes" else "No")