import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	}

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

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	}

} Main public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	} main {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String line1 = sc.nextLine(); line1 sc.nextLine() sc.nextLine sc String line2 = sc.nextLine(); line2 sc.nextLine() sc.nextLine sc int len1 = line1.length(); len1 line1.length() line1.length line1 int i = 0; i 0 while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		} i < len1 i len1 {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		} if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			} line1.contains(line2) line1.contains line1 line2 {
				System.out.println("Yes");
				break;
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" break; String a = line1.substring(0, 1); a line1.substring(0, 1) line1.substring line1 0 1 String b = line1.substring(1); b line1.substring(1) line1.substring line1 1 line1 = b + a line1 b + a b a i++ i if (i == line1.length()) {
			System.out.println("No");
		} i == line1.length() i line1.length() line1.length line1 {
			System.out.println("No");
		} 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) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		String line1 = sc.nextLine();
		String line2 = sc.nextLine();

		int len1 = line1.length();
		int i = 0;

		while (i < len1) {
			if (line1.contains(line2)) {
				System.out.println("Yes");
				break;
			}
			String a = line1.substring(0, 1);
			String b = line1.substring(1);
			line1 = b + a;
			i++;
		}

		if (i == line1.length()) {
			System.out.println("No");
		}
	}

}