

import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} import java.util.*; util.* java public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} Main public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} main {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) StringBuilder sb = new StringBuilder(); sb new StringBuilder() String str = scan.next(); str scan.next() scan.next scan String p = scan.next(); p scan.next() scan.next scan int result; result result = -1 result -1 1 char c; c List<String> list = new ArrayList<String>(); list new ArrayList<String>() for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		} int count = 0; int count = 0; count 0 count < str.length() count str.length() str.length str count++ count++ count {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		} {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		} c = str.charAt(count) c str.charAt(count) str.charAt str count list.add(String.valueOf(c)) list.add list String.valueOf(c) String.valueOf String c for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		} int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		} {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		} String min = list.get(0); min list.get(0) list.get list 0 for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			} int count2 = 1; int count2 = 1; count2 1 count2 <= str.length() count2 str.length() str.length str count2++ count2++ count2 {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			} {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			} if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				} count2 == str.length() count2 str.length() str.length str {
					sb.append(min);
					list.set(count2-1, min);
				} sb.append(min) sb.append sb min list.set(count2-1, min) list.set list count2-1 count2 1 min {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				} sb.append(list.get(count2)) sb.append sb list.get(count2) list.get list count2 list.set(count2-1, list.get(count2)) list.set list count2-1 count2 1 list.get(count2) list.get list count2 result = sb.indexOf(p) result sb.indexOf(p) sb.indexOf sb p if (result == 0) {
					break;
				} result == 0 result 0 {
					break;
				} break; str = new String(sb) str new String(sb) sb.delete(0, sb.length()) sb.delete sb 0 sb.length() sb.length sb if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} result == 0 result 0 {
			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 scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
} Main


import java.util.*;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		StringBuilder sb = new StringBuilder();
		String str = scan.next();
		String p = scan.next();
		int result;
		result = -1;// ?????????
		char c;
		List<String> list = new ArrayList<String>();

		// ????????????????????????????????????????´?

		for (int count = 0; count < str.length(); count++) {
			c = str.charAt(count);
			// char??????String??????????????????
			list.add(String.valueOf(c));
		}
		for (int i = 0; i < str.length(); i++) {
			
			//?????????????????????????????????????????????
			String min = list.get(0);
			
			// ??????????????????
			for (int count2 = 1; count2 <= str.length(); count2++) {
				
				
				// list???????????????????????????????????????p???????????????????????????????????????????????????????????????
				// list?????????String???
				if (count2 == str.length()) {
					sb.append(min);
					list.set(count2-1, min);
				} else {
					//StringBuilder?????\?????????????????????????????????????????????
					sb.append(list.get(count2));
					list.set(count2-1, list.get(count2));
				}
				//System.out.print(list.get(count2 - 1));
			}
				result = sb.indexOf(p);
				// ????????????????????????????????? ????????´???0 ??????????????´???-1
				if (result == 0) {
					break;
				}
				str = new String(sb);
				sb.delete(0, sb.length());
			
		}
		if (result == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}