import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	}

} Main public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	} main {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String a = scan.next(); a scan.next() scan.next scan String b = scan.next(); b scan.next() scan.next scan String[] a1 = a.split(""); a1 a.split("") a.split a "" String[] b1 = b.split(""); b1 b.split("") b.split b "" boolean judge = false; judge false for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		} int i = 0; int i = 0; i 0 i < a1.length i a1.length a1 a1.length i++ i++ i {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		} {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		} if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			} a1[i].equals(b1[i]) a1[i].equals a1[i] a1 i b1[i] b1 i {
			} {
				judge = true;
			} judge = true judge true if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		} judge == false judge false {
			System.out.println("Yes");
		} System.out.println("Yes") System.out.println System.out System System.out "Yes" if(judge == true) {
			System.out.println("No");
		} judge == true judge true {
			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) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	}

} public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		
		Scanner scan = new Scanner(System.in);
		
		String a = scan.next();
		String b = scan.next();
		
		String[] a1 = a.split("");
		String[] b1 = b.split("");
		
		boolean judge = false;
		
		for(int i = 0; i < a1.length; i++) {
			if(a1[i].equals(b1[i])) {
			}
			else {
				judge = true;
			}
		}
		
		if(judge == false) {
			System.out.println("Yes");
		}
		else if(judge == true) {
			System.out.println("No");
		}
	}

}
