import std.stdio, std.string, std.range, std.conv, std.array, std.algorithm, std.math, std.typecons;

void main() {
    auto S = readln.chomp;
    auto T = readln.chomp;
    foreach (i; 0..S.length) {
        if (S[i..$] ~ S[0..i] == T) {
            writeln("Yes");
            return;
        }
    }
    writeln("No");
}

