import java.util.*; 
 
class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
		String k=sc.next();
        String l=sc.next();
		String[] a=k.split("");
  		String[] b=l.split("");
  		int co=0;
  
		for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	}
    
 	if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }
 
    	System.out.println();
    }
} import java.util.*; util.* java class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
		String k=sc.next();
        String l=sc.next();
		String[] a=k.split("");
  		String[] b=l.split("");
  		int co=0;
  
		for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	}
    
 	if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }
 
    	System.out.println();
    }
} Main public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
		String k=sc.next();
        String l=sc.next();
		String[] a=k.split("");
  		String[] b=l.split("");
  		int co=0;
  
		for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	}
    
 	if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }
 
    	System.out.println();
    } main {
	Scanner sc=new Scanner(System.in);
		String k=sc.next();
        String l=sc.next();
		String[] a=k.split("");
  		String[] b=l.split("");
  		int co=0;
  
		for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	}
    
 	if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }
 
    	System.out.println();
    } Scanner sc=new Scanner(System.in); sc new Scanner(System.in) String k=sc.next(); k sc.next() sc.next sc String l=sc.next(); l sc.next() sc.next sc String[] a=k.split(""); a k.split("") k.split k "" String[] b=l.split(""); b l.split("") l.split l "" int co=0; co 0 for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	} int c=0; int c=0; c 0 c<k.length() c k.length() k.length k c++ c++ c {
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	} {
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	} if(!a[c].equals(b[c])){
             co=1;
              break;
            } !a[c].equals(b[c]) a[c].equals(b[c]) a[c].equals a[c] a c b[c] b c {
             co=1;
              break;
            } co=1 co 1 break; if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 } co==1 co 1 {
    		System.out.println("No");
    	} System.out.println("No") System.out.println System.out System System.out "No" {
     		System.out.println("Yes");
   	 } System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println() System.out.println System.out System System.out String[] args args
import java.util.*; 
 
class Main{
public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
		String k=sc.next();
        String l=sc.next();
		String[] a=k.split("");
  		String[] b=l.split("");
  		int co=0;
  
		for(int c=0;c<k.length();c++){
    		if(!a[c].equals(b[c])){
             co=1;
              break;
            }
    	}
    
 	if(co==1){
    		System.out.println("No");
    	}else{
     		System.out.println("Yes");
   	 }
 
    	System.out.println();
    }
}