import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	}

} import java.util.Scanner; Scanner java.util public class Main{
	public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	}

} Main public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	} main {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	} Scanner s = new Scanner(System.in); s new Scanner(System.in) String S = s.next(); S s.next() s.next s char[] Schrs = new char[S.length()]; Schrs new char[S.length()] S.length() S.length S String T = s.next(); T s.next() s.next s char[] Tchrs = new char[T.length()]; Tchrs new char[T.length()] T.length() T.length T String ans = "Yes"; ans "Yes" for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	} {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	} Schrs[i]= S.charAt(i) Schrs[i] Schrs i S.charAt(i) S.charAt S i Tchrs[i]= T.charAt(i) Tchrs[i] Tchrs i T.charAt(i) T.charAt T i if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;} Schrs[i]!=Tchrs[i] Schrs[i] Schrs i Tchrs[i] Tchrs i {ans ="No"; break;} ans ="No" ans "No" break; System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
	public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	}

} public class Main{
	public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	}

} Main
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
	String S = s.next(); 
	char[] Schrs = new char[S.length()];
	String T = s.next();
	char[] Tchrs = new char[T.length()];
	String ans = "Yes";
	
	for(int i=0; i<S.length(); i++) {
		Schrs[i]= S.charAt(i);
		Tchrs[i]= T.charAt(i);
		if(Schrs[i]!=Tchrs[i]) {ans ="No"; break;}
		
	}
		System.out.println(ans);
		
	}

}
