(defn StringRotation [[S T]]
  (if (-> (apply str (repeat 2 S))
        (clojure.string/includes? T))
    "Yes"
    "No"))

(defn input []
  (vector (read-line) (read-line)))

(-> (input)
  StringRotation
  println)