'use strict';
(function(stdin) {
  var lines  = stdin.toString().split('\n');
  var result = (function(source,word) {
    return {
      true:'Yes',false:'No'
    }[source.concat(source).indexOf(word) !== -1];

  }(lines[0],lines[1]
  ));
  console.log(result);
}(require('fs').readFileSync('/dev/stdin', 'utf8')));