import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
					
		String str, str2;
		
		char l;
		char s;
		
		int sum[] = new int[26];
		
		l = 'A';
		s = 'a';
			
		str = br.readLine();
		str2 = br.readLine();
		
		boolean flag = false;
		
		char ch[] = str.toCharArray();
		char ch2[] = str2.toCharArray();
		for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		}
		if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
					
		String str, str2;
		
		char l;
		char s;
		
		int sum[] = new int[26];
		
		l = 'A';
		s = 'a';
			
		str = br.readLine();
		str2 = br.readLine();
		
		boolean flag = false;
		
		char ch[] = str.toCharArray();
		char ch2[] = str2.toCharArray();
		for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		}
		if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
} Main public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
					
		String str, str2;
		
		char l;
		char s;
		
		int sum[] = new int[26];
		
		l = 'A';
		s = 'a';
			
		str = br.readLine();
		str2 = br.readLine();
		
		boolean flag = false;
		
		char ch[] = str.toCharArray();
		char ch2[] = str2.toCharArray();
		for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		}
		if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	} main {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
					
		String str, str2;
		
		char l;
		char s;
		
		int sum[] = new int[26];
		
		l = 'A';
		s = 'a';
			
		str = br.readLine();
		str2 = br.readLine();
		
		boolean flag = false;
		
		char ch[] = str.toCharArray();
		char ch2[] = str2.toCharArray();
		for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		}
		if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	} InputStreamReader isr = new InputStreamReader(System.in); isr new InputStreamReader(System.in) BufferedReader br = new BufferedReader(isr); br new BufferedReader(isr) String str str str2; str2 char l; l char s; s int sum[] = new int[26]; sum new int[26] 26 l = 'A' l 'A' s = 'a' s 'a' str = br.readLine() str br.readLine() br.readLine br str2 = br.readLine() str2 br.readLine() br.readLine br boolean flag = false; flag false char ch[] = str.toCharArray(); ch str.toCharArray() str.toCharArray str char ch2[] = str2.toCharArray(); ch2 str2.toCharArray() str2.toCharArray str2 for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		} int i = 0; int i = 0; i 0 i < ch.length i ch.length ch ch.length i++ i++ i {
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		} {
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		} if(flag == true)break; flag == true flag true break; for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			} int j = 0; int j = 0; j 0 j < ch2.length j ch2.length ch2 ch2.length j++ j++ j {
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			} {
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			} if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				} ch.length > i + j ch.length ch ch.length i + j i j {
					if(ch2[j] != ch[i + j]){
						break;
					}
				} if(ch2[j] != ch[i + j]){
						break;
					} ch2[j] != ch[i + j] ch2[j] ch2 j ch[i + j] ch i + j i j {
						break;
					} break; {
					if(ch2[j] != ch[i + j - ch.length])break;
				} if(ch2[j] != ch[i + j - ch.length])break; ch2[j] != ch[i + j - ch.length] ch2[j] ch2 j ch[i + j - ch.length] ch i + j - ch.length i + j i j ch.length ch ch.length break; if(j == ch2.length - 1){
					flag = true;
				} j == ch2.length - 1 j ch2.length - 1 ch2.length ch2 ch2.length 1 {
					flag = true;
				} flag = true flag true if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		} flag == true flag true {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" {
			System.out.println("No");
		} System.out.println("No") System.out.println System.out System System.out "No" String args[] args
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

	public static void main(String args[]) throws IOException {
		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);
					
		String str, str2;
		
		char l;
		char s;
		
		int sum[] = new int[26];
		
		l = 'A';
		s = 'a';
			
		str = br.readLine();
		str2 = br.readLine();
		
		boolean flag = false;
		
		char ch[] = str.toCharArray();
		char ch2[] = str2.toCharArray();
		for(int i = 0; i < ch.length; i++){
			if(flag == true)break;
			for(int j = 0; j < ch2.length; j++){
				if(ch.length > i + j){
					if(ch2[j] != ch[i + j]){
						break;
					}
				}else{
					if(ch2[j] != ch[i + j - ch.length])break;
				}
				if(j == ch2.length - 1){
					flag = true;
				}
			}
		}
		if(flag == true){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}