import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} Main public static void main(String[] args) {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  } main {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  } Scanner console = new Scanner(System.in); console new Scanner(System.in) String word1 = console.next(); word1 console.next() console.next console String word2 = console.next(); word2 console.next() console.next console String end = word2.substring(0, word1.length()); end word2.substring(0, word1.length()) word2.substring word2 0 word1.length() word1.length word1 if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    } word1.compareTo(end) == 0 word1.compareTo(end) word1.compareTo word1 end 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 console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} public class Main {
  public static void main(String[] args) {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
} Main
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner console = new Scanner(System.in);
    String word1 = console.next();
    String word2 = console.next();
    String end = word2.substring(0, word1.length());
    if (word1.compareTo(end) == 0) {
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }
  }
}
