
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		String ans ="No";
		for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		}
		System.out.println(ans);
	}
} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util import java.util.Scanner; Scanner java.util class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		String ans ="No";
		for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		}
		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();
		
		String ans ="No";
		for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		}
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		String ans ="No";
		for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		}
		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 String ans ="No"; ans "No" for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		} int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s i++ i++ i {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		} {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		} String a = ""; a "" for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			} int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			} {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			} if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				} j == s.length() - 1 j s.length() - 1 s.length() s.length s 1 {
					a = s.substring(j, j + 1) + a;
				} a = s.substring(j, j + 1) + a a s.substring(j, j + 1) + a s.substring(j, j + 1) s.substring s j j + 1 j 1 a {
					a += s.substring(j, j + 1);
				} a += s.substring(j, j + 1) a s.substring(j, j + 1) s.substring s j j + 1 j 1 if (a.equals(t)) {
				ans = "Yes";
				break;
			} a.equals(t) a.equals a t {
				ans = "Yes";
				break;
			} ans = "Yes" ans "Yes" break; s = a s a System.out.println(ans) System.out.println System.out System System.out ans String args[] args

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String t = sc.next();
		
		String ans ="No";
		for (int i = 0; i < s.length(); i++) {
			String a = "";
			for (int j = 0; j < s.length(); j++) {
				if (j == s.length() - 1) {
					a = s.substring(j, j + 1) + a;
				} else {
					a += s.substring(j, j + 1);
				}
			}
			if (a.equals(t)) {
				ans = "Yes";
				break;
			}
			s = a;
		}
		System.out.println(ans);
	}
}