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