import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    }
} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    } main {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String oldID = scan.nextLine(); oldID scan.nextLine() scan.nextLine scan String newID = scan.nextLine(); newID scan.nextLine() scan.nextLine scan for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        } int i = 0; int i = 0; i 0 i < oldID.length() i oldID.length() oldID.length oldID i++ i++ i {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        } {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        } if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            } oldID.charAt(i) != newID.charAt(i) oldID.charAt(i) oldID.charAt oldID i newID.charAt(i) newID.charAt newID i {
                System.out.println("No");
                scan.close();
                return;
            } System.out.println("No") System.out.println System.out System System.out "No" scan.close() scan.close scan return; System.out.println("Yes") System.out.println System.out System System.out "Yes" scan.close() scan.close scan return; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String oldID = scan.nextLine();
        String newID = scan.nextLine();

        for(int i = 0; i < oldID.length(); i++) {
            if(oldID.charAt(i) != newID.charAt(i)) {
                System.out.println("No");
                scan.close();
                return;
            }
        }
        System.out.println("Yes");
        scan.close();
        return;
    }
}