let () =
  let s =
    let s' = read_line () in
    String.concat  "" [s';s']
  in
  let t = read_line () in
  let s_len, t_len = String.length s, String.length t in
  let rec crawl s_i t_i =
    if t_i < t_len then
      begin
        if s_i < s_len then
          begin
            if s.[s_i] = t.[t_i] then crawl (s_i+1) (t_i+1)
            else crawl (s_i - t_i + 1) 0
          end
        else "No"
      end
    else "Yes"
  in
  print_string @@ crawl 0 0;
  print_string "\n";
;;
