import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            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.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            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.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } main {
        Scanner sc = new Scanner(System.in);
        String S = sc.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String S = sc.nextLine(); S sc.nextLine() sc.nextLine sc String T = sc.nextLine(); T sc.nextLine() sc.nextLine sc sc.close() sc.close sc boolean isOK = true; isOK true for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        } int i = 0; int i = 0; i 0 i < S.length() i S.length() S.length S i++ i++ i {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        } {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        } char sVal = S.charAt(i); sVal S.charAt(i) S.charAt S i char tVal = T.charAt(i); tVal T.charAt(i) T.charAt T i if (sVal != tVal) {
                isOK = false;
                break;
            } sVal != tVal sVal tVal {
                isOK = false;
                break;
            } isOK = false isOK false break; if (isOK) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } isOK {
            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 sc = new Scanner(System.in);
        String S = sc.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            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.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            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.nextLine();
        String T = sc.nextLine();
        sc.close();

        boolean isOK = true;
        for (int i = 0; i < S.length(); i++) {
            char sVal = S.charAt(i);
            char tVal = T.charAt(i);
            if (sVal != tVal) {
                isOK = false;
                break;
            }
        }

        if (isOK) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }

}
