
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	}

} Main public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	} main {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "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.indexOf(t) > -1) ? "Yes" : "No") System.out.println System.out System System.out (s.indexOf(t) > -1) ? "Yes" : "No" (s.indexOf(t) > -1) s.indexOf(t) s.indexOf s t -1 1 "Yes" "No" String[] args args public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	}

} public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	}

} Main

import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		
		Scanner sc = new Scanner(System.in);
		
		String s = sc.next();
		String t = sc.next();
		
		s = s + s;
		
		System.out.println((s.indexOf(t) > -1) ? "Yes" : "No");
		
	}

}
