import java.util.*;
import java.util.Arrays;
public class Main{
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    }
} import java.util.*; util.* java import java.util.Arrays; Arrays java.util public class Main{
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    }
} Main public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    } main {
      Scanner sc = new Scanner(System.in);
      String a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String a = sc.next(); a sc.next() sc.next sc String b = sc.next(); b sc.next() sc.next sc int flag = 0; flag 0 char []x =a.toCharArray(); x a.toCharArray() a.toCharArray a char []y =b.toCharArray(); y b.toCharArray() b.toCharArray b for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      } int i=0; int i=0; i 0 i<x.length i x.length x x.length i++ i++ i {
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      } {
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      } if(x[i]!=y[i]){
          flag = 1;
          break;
        } x[i]!=y[i] x[i] x i y[i] y i {
          flag = 1;
          break;
        } flag = 1 flag 1 break; if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      } flag==0 flag 0 {
        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 a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        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 a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    }
} Main
import java.util.*;
import java.util.Arrays;
public class Main{
    public static void main(String[] args){
      Scanner sc = new Scanner(System.in);
      String a = sc.next();
      String b = sc.next();
      int flag = 0;
      char []x =a.toCharArray();
      char []y =b.toCharArray();
      for(int i=0;i<x.length;i++){
        if(x[i]!=y[i]){
          flag = 1;
          break;
        }
      }
      if(flag==0){
        System.out.println("Yes");
      }
      else{
        System.out.println("No");

      }

     

      
    }
}