
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	} main {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.nextLine(); S scan.nextLine() scan.nextLine scan String T = scan.nextLine(); T scan.nextLine() scan.nextLine scan int flag = 0; flag 0 for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		} int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		} {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		} if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			} S.charAt(i) == T.charAt(i) S.charAt(i) S.charAt S i T.charAt(i) T.charAt T i {
				continue;
			} continue; {
				flag = 1;
				break;
			} flag = 1 flag 1 break; if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		} flag == 0 flag 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" scan.close() scan.close scan String[] args args public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	}
} Main

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String S = scan.nextLine();
		String T = scan.nextLine();
		int flag = 0;

		for(int i = 0; i < S.length(); i++) {
			if(S.charAt(i) == T.charAt(i)) {
				continue;
			}else {
				flag = 1;
				break;
			}
		}

		if(flag == 0) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
		scan.close();
	}
}
