import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    }
} Main public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc s = s + s s s + s s s System.out.println(s.contains(t) ? "Yes" : "No") System.out.println System.out System System.out s.contains(t) ? "Yes" : "No" s.contains(t) s.contains s t "Yes" "No" String args[] args public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    }
} public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String args[]) throws Exception {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        String t = sc.next();
        s = s + s;
        System.out.println(s.contains(t) ? "Yes" : "No");
    }
}
