import java.util.Scanner;

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

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






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

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






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

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






	} main {
		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.nextLine(); s sc.nextLine() sc.nextLine sc String p = sc.nextLine(); p sc.nextLine() sc.nextLine sc boolean contain = false; contain false if(s.contains(p)) {
			contain = true;
		} s.contains(p) s.contains s p {
			contain = true;
		} contain = true contain true for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		} int i = 1; int i = 1; i 1 i<p.length() i p.length() p.length p i++ i++ i {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		} {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		} String end = p.substring(0,i); end p.substring(0,i) p.substring p 0 i String start = p.substring(i); start p.substring(i) p.substring p i if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			} s.endsWith(end) s.endsWith s end {
				if(s.startsWith(start)) {
					contain = true;
				}
			} if(s.startsWith(start)) {
					contain = true;
				} s.startsWith(start) s.startsWith s start {
					contain = true;
				} contain = true contain true if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} contain {
			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 public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






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

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






	}
} Main
import java.util.Scanner;

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

		String s = sc.nextLine();
		String p = sc.nextLine();

		boolean contain = false;

		if(s.contains(p)) {
			contain = true;
		}

		for(int i = 1;i<p.length();i++) {
			String end = p.substring(0,i);
			String start = p.substring(i);
			if(s.endsWith(end)){
				if(s.startsWith(start)) {
					contain = true;
				}
			}
		}

		if(contain) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}






	}
}
