import java.util.Scanner;

public class Main {

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

		String inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			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 inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			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 inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();

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

		String inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String inputId = sc.nextLine(); inputId sc.nextLine() sc.nextLine sc String inputAddId = sc.nextLine(); inputAddId sc.nextLine() sc.nextLine sc int flag = 0; flag 0 for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		} int i = 0; int i = 0; i 0 i < inputId.length() i inputId.length() inputId.length inputId i++ i++ i {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		} {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		} if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			} inputId.charAt(i) != inputAddId.charAt(i) inputId.charAt(i) inputId.charAt inputId i inputAddId.charAt(i) inputAddId.charAt inputAddId i {
				flag++;
			} flag++ flag if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		} flag == 0 && (inputAddId.length() - inputId.length() == 1) flag == 0 flag 0 (inputAddId.length() - inputId.length() == 1) inputAddId.length() - inputId.length() inputAddId.length() inputAddId.length inputAddId inputId.length() inputId.length inputId 1 {
			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 inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			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 inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			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 inputId = sc.nextLine();
		String inputAddId = sc.nextLine();

		int flag = 0;

		for (int i = 0; i < inputId.length(); i++) {

			if (inputId.charAt(i) != inputAddId.charAt(i)) {
				flag++;
			}
		}

		if (flag == 0 && (inputAddId.length() - inputId.length() == 1)) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();

	}
}
