function main(input) {
  var input = input.split("\n")
  var text = input[0].slice()
  text = text.split("")
  
  for (var i = 0; i <= text.length; i++) {
    var p = text.shift()
    text.push(p)
    if(text.join("") === input[1]) {
      console.log("yes")
      return
    }
  }
  console.log("no")
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));