import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
} 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.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String p = sc.next(); p sc.next() sc.next sc char[] characterS = s.toCharArray(); characterS s.toCharArray() s.toCharArray s char[] characterC = p.toCharArray(); characterC p.toCharArray() p.toCharArray p int i i j j l; l int count = 0; count 0 if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} count == p.length() count p.length() p.length p {
			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" sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String p = sc.next();
		char[] characterS = s.toCharArray();
		char[] characterC = p.toCharArray();
		int i, j, l;
		int count = 0;
		top: for (i = 0; i < s.length(); i++) {
			for (j = 0, l = 0; j < p.length();) {
				try {
					if (characterC[j] == characterS[j + i]) {
						count++;
					}
				} catch (java.lang.ArrayIndexOutOfBoundsException e) {
					if (characterC[j] == characterS[l]) {
						count++;
						l++;
					}
				} finally {
					j++;
				}
			}
			if (count == p.length()) {
				break top;
			} else {
				count = 0;
			}
		}
		if (count == p.length()) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
		sc.close();
	}
}
