import java.util.*;

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

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String[] S = sc.next().split("");
    String[] T = sc.next().split("");
    String ret = "Yes";
    for (int i = 0; i < S.length; i++) {
      if (!S[i].equals(T[i])) {
        ret = "No";
        break;
      }
    }
    System.out.println(ret);
  }
}
