import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    String a=scan.next();
    String b=scan.next();
    String[] a1=a.split("");
    String[] b1=b.split("");
    boolean flag=true;
    for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    }
    if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} import java.util.Scanner; Scanner java.util class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    String a=scan.next();
    String b=scan.next();
    String[] a1=a.split("");
    String[] b1=b.split("");
    boolean flag=true;
    for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    }
    if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
} Main public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    String a=scan.next();
    String b=scan.next();
    String[] a1=a.split("");
    String[] b1=b.split("");
    boolean flag=true;
    for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    }
    if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } main {
    Scanner scan=new Scanner(System.in);
    String a=scan.next();
    String b=scan.next();
    String[] a1=a.split("");
    String[] b1=b.split("");
    boolean flag=true;
    for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    }
    if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  } Scanner scan=new Scanner(System.in); scan new Scanner(System.in) String a=scan.next(); a scan.next() scan.next scan String b=scan.next(); b scan.next() scan.next scan String[] a1=a.split(""); a1 a.split("") a.split a "" String[] b1=b.split(""); b1 b.split("") b.split b "" boolean flag=true; flag true for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    } int x=0; int x=0; x 0 x<a1.length x a1.length a1 a1.length x++ x++ x {
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    } {
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    } if(!(a1[x].equals(b1[x]))){
        flag=false;
      } !(a1[x].equals(b1[x])) (a1[x].equals(b1[x])) a1[x].equals a1[x] a1 x b1[x] b1 x {
        flag=false;
      } flag=false flag false if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    } flag {
      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
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scan=new Scanner(System.in);
    String a=scan.next();
    String b=scan.next();
    String[] a1=a.split("");
    String[] b1=b.split("");
    boolean flag=true;
    for(int x=0; x<a1.length; x++){
      if(!(a1[x].equals(b1[x]))){
        flag=false;
      }
    }
    if(flag){
      System.out.println("Yes");
    }else{
      System.out.println("No");
    }
  }
}