import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	}
} Main public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	} main {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String s=scan.next() s scan.next() scan.next scan p=scan.next(); p scan.next() scan.next scan for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		} int i=0; int i=0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		} {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		} if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			} s.indexOf(p)!=-1 s.indexOf(p) s.indexOf s p -1 1 {
				System.out.println("Yes");
				return;
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" return; char ch=s.charAt(s.length()-1); ch s.charAt(s.length()-1) s.charAt s s.length()-1 s.length() s.length s 1 s=s.substring(0,s.length()-1) s s.substring(0,s.length()-1) s.substring s 0 s.length()-1 s.length() s.length s 1 s=ch+s s ch+s ch s System.out.println("No") System.out.println System.out System System.out "No" String[] args args public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	}
} public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	}
} Main
import java.util.Scanner;
public class Main {
	public static void main(String[] args) throws Exception {
		Scanner scan=new Scanner(System.in);
		String s=scan.next(),p=scan.next();
		for(int i=0;i<s.length();i++) {
			if(s.indexOf(p)!=-1) {
				System.out.println("Yes");
				return;
			}
			char ch=s.charAt(s.length()-1);
			s=s.substring(0,s.length()-1);
			s=ch+s;
		}
		System.out.println("No");
	}
}
