import java.util.Scanner;
public class Main {
	void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
} Main void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	} run {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String s = scan.next(); s scan.next() scan.next scan String p = scan.next(); p scan.next() scan.next scan int sLen = s.length(); sLen s.length() s.length s int pLen = p.length(); pLen p.length() p.length p for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		} int i = 0; int i = 0; i 0 i < sLen i sLen i++ i++ i {
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		} {
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		} boolean check = true; check true for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			} int j = 0; int j = 0; j 0 j < pLen j pLen j++ j++ j {
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			} {
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			} int index; index if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				} sLen <= i + j sLen i + j i j {
					index = (sLen - (i + j)) * -1; 
				} index = (sLen - (i + j)) * -1 index (sLen - (i + j)) * -1 (sLen - (i + j)) sLen (i + j) i j -1 1 {
					index = i + j;
				} index = i + j index i + j i j char sC = s.charAt(index); sC s.charAt(index) s.charAt s index char pC = p.charAt(j); pC p.charAt(j) p.charAt p j if(sC != pC){
					check = false;
					break;
				} sC != pC sC pC {
					check = false;
					break;
				} check = false check false break; if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			} check {
				System.out.println("Yes");
				break;
			} System.out.println("Yes") System.out.println System.out System System.out "Yes" break; if(i == sLen - 1){
				System.out.println("No");
				break;
			} i == sLen - 1 i sLen - 1 sLen 1 {
				System.out.println("No");
				break;
			} System.out.println("No") System.out.println System.out System System.out "No" break; public static void main(String args[]){
		new Main().run();
	} main {
		new Main().run();
	} new Main().run() new Main().run new Main() String args[] args public class Main {
	void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
} public class Main {
	void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
} Main
import java.util.Scanner;
public class Main {
	void run(){
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		String p = scan.next();
		int sLen = s.length();
		int pLen = p.length();
		for(int i = 0;i < sLen;i++){
			boolean check = true;
			for(int j = 0;j < pLen;j++){
				int index;
				if(sLen <= i + j){
					index = (sLen - (i + j)) * -1; 
				}else{
					index = i + j;
				}
				char sC = s.charAt(index);
				char pC = p.charAt(j);
				if(sC != pC){
					check = false;
					break;
				}
			}
			if(check){
				System.out.println("Yes");
				break;
			}else if(i == sLen - 1){
				System.out.println("No");
				break;
			}
		}
	}
	public static void main(String args[]){
		new Main().run();
	}
}