(println (let [s1 (read-line)
               t  (read-line)]
           (loop [s s1 times (count t)]
             (let [rotated (apply str (last s) (butlast s))]
               (if (zero? times)
                 "No"
                 (if (= rotated t)
                   "Yes"
                   (recur rotated (dec times))))))))