import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        String a=stdIn.next();
        String b=stdIn.next();
        int sum=0;

        String []c=a.split("");
        String []d=b.split("");
        for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        }
        
        if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        }
        
        
        
    }

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

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        String a=stdIn.next();
        String b=stdIn.next();
        int sum=0;

        String []c=a.split("");
        String []d=b.split("");
        for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        }
        
        if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        }
        
        
        
    }

} Main public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        String a=stdIn.next();
        String b=stdIn.next();
        int sum=0;

        String []c=a.split("");
        String []d=b.split("");
        for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        }
        
        if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        }
        
        
        
    } main {
        Scanner stdIn=new Scanner(System.in);

        String a=stdIn.next();
        String b=stdIn.next();
        int sum=0;

        String []c=a.split("");
        String []d=b.split("");
        for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        }
        
        if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        }
        
        
        
    } Scanner stdIn=new Scanner(System.in); stdIn new Scanner(System.in) String a=stdIn.next(); a stdIn.next() stdIn.next stdIn String b=stdIn.next(); b stdIn.next() stdIn.next stdIn int sum=0; sum 0 String []c=a.split(""); c a.split("") a.split a "" String []d=b.split(""); d b.split("") b.split b "" for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        } int i=0; int i=0; i 0 i<c.length i c.length c c.length i++ i++ i {
            if(c[i].equals(d[i])){
                sum++;
            }
        } {
            if(c[i].equals(d[i])){
                sum++;
            }
        } if(c[i].equals(d[i])){
                sum++;
            } c[i].equals(d[i]) c[i].equals c[i] c i d[i] d i {
                sum++;
            } sum++ sum if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        } d.length-1==sum d.length-1 d.length d d.length 1 sum {
            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
import java.util.Scanner;

class Main {

    public static void main(String[] args) {
        Scanner stdIn=new Scanner(System.in);

        String a=stdIn.next();
        String b=stdIn.next();
        int sum=0;

        String []c=a.split("");
        String []d=b.split("");
        for(int i=0; i<c.length; i++){
            if(c[i].equals(d[i])){
                sum++;
            }
        }
        
        if(d.length-1==sum){
            System.out.println("Yes");
            
        }
        else{
            System.out.println("No");
            
        }
        
        
        
    }

}