import java.util.*;
import java.util.List;
import java.util.ArrayList;
import java.math.*;
class Main{
    public static void main(String[]args){
        Scanner scanner = new Scanner(System.in);
        String[] S = new String[11]; S = scanner.nextLine().split("");
        String[] T = new String[11]; T = scanner.nextLine().split("");
        for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        }
    }

} import java.util.*; util.* java import java.util.List; List java.util import java.util.ArrayList; ArrayList java.util import java.math.*; math.* java class Main{
    public static void main(String[]args){
        Scanner scanner = new Scanner(System.in);
        String[] S = new String[11]; S = scanner.nextLine().split("");
        String[] T = new String[11]; T = scanner.nextLine().split("");
        for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        }
    }

} Main public static void main(String[]args){
        Scanner scanner = new Scanner(System.in);
        String[] S = new String[11]; S = scanner.nextLine().split("");
        String[] T = new String[11]; T = scanner.nextLine().split("");
        for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        }
    } main {
        Scanner scanner = new Scanner(System.in);
        String[] S = new String[11]; S = scanner.nextLine().split("");
        String[] T = new String[11]; T = scanner.nextLine().split("");
        for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String[] S = new String[11]; S new String[11] 11 S = scanner.nextLine().split("") S scanner.nextLine().split("") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner "" String[] T = new String[11]; T new String[11] 11 T = scanner.nextLine().split("") T scanner.nextLine().split("") scanner.nextLine().split scanner.nextLine() scanner.nextLine scanner "" for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        } 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]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        } {
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        } if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            } !(S[i].equals(T[i])) (S[i].equals(T[i])) S[i].equals S[i] S i T[i] T i {
                System.out.println("No");
                break;
            } System.out.println("No") System.out.println System.out System System.out "No" break; {
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            } if(i==S.length-1){
                    System.out.println("Yes");
                } i==S.length-1 i S.length-1 S.length S S.length 1 {
                    System.out.println("Yes");
                } System.out.println("Yes") System.out.println System.out System System.out "Yes" String[]args args
import java.util.*;
import java.util.List;
import java.util.ArrayList;
import java.math.*;
class Main{
    public static void main(String[]args){
        Scanner scanner = new Scanner(System.in);
        String[] S = new String[11]; S = scanner.nextLine().split("");
        String[] T = new String[11]; T = scanner.nextLine().split("");
        for(int i=0;i<S.length;i++){
            if(!(S[i].equals(T[i]))){
                System.out.println("No");
                break;
            }
            else{
                if(i==S.length-1){
                    System.out.println("Yes");
                }
            }
        }
    }

}