import std.stdio;
import std.string;

void main()
{
    char[] s, t;
    readf(" %s %s", &s, &t);
    string ans = "No";

    foreach (i; 0..s.length){
        s = s[$ - 1] ~ s[0..$ - 2];
        if (s == t){
            ans = "Yes";
            break;
        }
    }
    writeln(ans);
}
