import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	} main {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String word1 = sc.next(); word1 sc.next() sc.next sc String word2 = sc.next(); word2 sc.next() sc.next sc String result = "No"; result "No" StringBuilder sb = new StringBuilder(); sb new StringBuilder() sb.append(word1) sb.append sb word1 int word1Size = word1.length(); word1Size word1.length() word1.length word1 for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		} int i = word1Size-1; int i = word1Size-1; i word1Size-1 word1Size 1 i >= 0 i 0 i-- i-- i {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		} {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		} sb.insert(0, word1.charAt(i)) sb.insert sb 0 word1.charAt(i) word1.charAt word1 i sb.deleteCharAt(word1Size) sb.deleteCharAt sb word1Size if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			} sb.toString().equals(word2) sb.toString().equals sb.toString() sb.toString sb word2 {
				result = "Yes";
				break;
			} result = "Yes" result "Yes" break; System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	}
} public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	}
} Main
import java.util.Scanner;

public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String word1 = sc.next();
		String word2 = sc.next();
		String result = "No";

		StringBuilder sb = new StringBuilder();
		sb.append(word1);


		int word1Size = word1.length();
		for (int i = word1Size-1; i >= 0; i--) {
			sb.insert(0, word1.charAt(i));
			sb.deleteCharAt(word1Size);
			if (sb.toString().equals(word2)) {
				result = "Yes";
				break;
			}
		}
		System.out.println(result);
	}
}
