import Foundation
var s = readLine()!
let t = readLine()!
for _ in 0..<t.count {
  if s == t {
    print("Yes")
    exit(0)
  }
  let c = s[s.index(s.endIndex, offsetBy: -1)]
  s = "\(c)\(String(s.dropLast()))"
}
print("No")