import 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();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	} 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 int N = T.length(); N T.length() T.length T String ans = "No"; ans "No" for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		} int i = 0; int i = 0; i 0 i < N i N i++ i++ i {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		} {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		} String S1 = S.substring(0, i); S1 S.substring(0, i) S.substring S 0 i String S2 = S.substring(i, N); S2 S.substring(i, N) S.substring S i N if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			} T.equals( S2+S1 ) T.equals T S2+S1 S2 S1 {
				ans = "Yes"; 
				break;
			} ans = "Yes" ans "Yes" break; System.out.println(ans) System.out.println System.out System System.out ans 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();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String T = sc.next();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
} Main
import 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();
		
		int N = T.length();
		
		String ans = "No";
		

		for (int i = 0; i < N; i++) {
			String S1 = S.substring(0, i);
			String S2 = S.substring(i, N);
			
			if( T.equals( S2+S1 ) ){
				ans = "Yes"; 
				break;
			}
		}
		System.out.println(ans);
	}
}