import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	}
} import java.util.Scanner; Scanner java.util import java.util.Arrays; Arrays java.util import java.util.List; List java.util public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	}
} Main public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	} main {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input1 = sc.nextLine(); input1 sc.nextLine() sc.nextLine sc String input2 = sc.nextLine(); input2 sc.nextLine() sc.nextLine sc String before = input2.substring(0, input2.length()-1); before input2.substring(0, input2.length()-1) input2.substring input2 0 input2.length()-1 input2.length() input2.length input2 1 String result = input1.equals(before) ? "Yes" : "No"; result input1.equals(before) ? "Yes" : "No" input1.equals(before) input1.equals input1 before "Yes" "No" System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	}
} public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	}
} Main
import java.util.Scanner;
import java.util.Arrays;
import java.util.List;

public class Main {
	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    String input1 = sc.nextLine();
	    String input2 = sc.nextLine();
		String before = input2.substring(0, input2.length()-1);
		String result = input1.equals(before) ? "Yes" : "No";
	    System.out.println(result);
	}
}
