object Main extends App {
  val in = new java.util.Scanner(System.in)
  val S, T = in.next
  val rots = (0 until S.size).map {i =>
    val (l, r) = S.splitAt(i)
    r + l
  }
  println(if (rots.contains(T)) "Yes" else "No")
}