import java.util.Scanner;
 
public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	}
} Main public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	} main {
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	} Scanner in = new Scanner(System.in); in new Scanner(System.in) String S = in.next(); S in.next() in.next in String T = in.next(); T in.next() in.next in boolean onazi = true; onazi true boolean komozi = true; komozi true boolean mozisu = false; mozisu false boolean tuika = false; tuika false for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		} {
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		} char a = S.charAt(i); a S.charAt(i) S.charAt S i char b = T.charAt(i); b T.charAt(i) T.charAt T i if(!(a == b)){
            	onazi = false;
            } !(a == b) (a == b) a b {
            	onazi = false;
            } onazi = false onazi false for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} int i=0; int i=0; i 0 i<S.length() i S.length() S.length S i++ i++ i {
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} {
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} char x = S.charAt(i); x S.charAt(i) S.charAt S i if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		} x >= 'A' && x <= 'Z' x >= 'A' x 'A' x <= 'Z' x 'Z' {
    			komozi = false;
    		} komozi = false komozi false for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} int i=0; int i=0; i 0 i<T.length() i T.length() T.length T i++ i++ i {
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} {
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	} char x = T.charAt(i); x T.charAt(i) T.charAt T i if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		} x >= 'A' && x <= 'Z' x >= 'A' x 'A' x <= 'Z' x 'Z' {
    			komozi = false;
    		} komozi = false komozi false if(1<=S.length() && S.length()<=10){
          mozisu = true;
        } 1<=S.length() && S.length()<=10 1<=S.length() 1 S.length() S.length S S.length()<=10 S.length() S.length S 10 {
          mozisu = true;
        } mozisu = true mozisu true if(T.length() == (S.length()+1)){
        	tuika = true;
        } T.length() == (S.length()+1) T.length() T.length T (S.length()+1) S.length() S.length S 1 {
        	tuika = true;
        } tuika = true tuika true if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        } onazi && komozi && mozisu && tuika mozisu onazi && komozi && mozisu && tuika onazi komozi mozisu tuika {
        	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" String[] args args public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	}
} public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		String S = in.next();
		String T = in.next();
		boolean onazi = true;
		boolean komozi = true;
		boolean mozisu = false;
    	boolean tuika = false;
    	
    	//条件
		for(int i=0; i<S.length(); i++){
			char a = S.charAt(i);
            char b = T.charAt(i);
            if(!(a == b)){
            	onazi = false;
            }
		}
    	for(int i=0; i<S.length(); i++){
            char x = S.charAt(i);
    		if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
    	for(int i=0; i<T.length(); i++){
			char x = T.charAt(i);
			if(x >= 'A' && x <= 'Z') {
    			komozi = false;
    		}
    	}
        if(1<=S.length() && S.length()<=10){
          mozisu = true;
        }
        if(T.length() == (S.length()+1)){
        	tuika = true;
        }
        
        //判定
        if(onazi && komozi && mozisu && tuika){
        	System.out.println("Yes");
        }else{
        	System.out.println("No");
        }
	}
}