import std.algorithm, std.array, std.container, std.range, std.bitmanip;
import std.numeric, std.math, std.bigint, std.random, core.bitop;
import std.string, std.ascii, std.regex, std.conv, std.stdio, std.typecons;

void main()
{
  auto s = readln.chomp;
  auto p = readln.chomp;

  foreach (i; 0..s.length)
    if ((s[i..$] ~ s[0..i]).indexOf(p) != -1) {
      writeln("Yes");
      return;
    }

  writeln("No");
}