import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    } main {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] s = sc.next().split(""); s sc.next().split("") sc.next().split sc.next() sc.next sc "" String[] t = sc.next().split(""); t sc.next().split("") sc.next().split sc.next() sc.next sc "" boolean flg = true; flg true for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        } int i = 0; int i = 0; i 0 i < s.length i s.length s s.length i++ i++ i {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        } {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        } if (s[i].equals(t[i])) {continue;}
            else flg = false; s[i].equals(t[i]) s[i].equals s[i] s i t[i] t i {continue;} continue; flg = false flg false if (flg) {System.out.println("Yes");}
        else System.out.println("No"); flg {System.out.println("Yes");} System.out.println("Yes") System.out.println System.out System System.out "Yes" 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 sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    }
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String[] s = sc.next().split("");
        String[] t = sc.next().split("");
        boolean flg = true;
        for (int i = 0; i < s.length; i++) {
            if (s[i].equals(t[i])) {continue;}
            else flg = false;
        }
        if (flg) {System.out.println("Yes");}
        else System.out.println("No");
    }
}