import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} Main public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} main {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String pass1 = scan.nextLine(); pass1 scan.nextLine() scan.nextLine scan String pass2 = scan.nextLine(); pass2 scan.nextLine() scan.nextLine scan String passCheck = "0K"; passCheck "0K" int length = pass2.length(); length pass2.length() pass2.length pass2 if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		} length == 2 length 2 {
			passCheck = pass2.substring(0 , 1);
		} passCheck = pass2.substring(0 , 1) passCheck pass2.substring(0 , 1) pass2.substring pass2 0 1 {
			passCheck = pass2.substring(0 , length - 1);
		} passCheck = pass2.substring(0 , length - 1) passCheck pass2.substring(0 , length - 1) pass2.substring pass2 0 length - 1 length 1 if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		} pass1.equals(passCheck) pass1.equals pass1 passCheck {
			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 scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);

		String pass1 = scan.nextLine();
		String pass2 = scan.nextLine();
		String passCheck = "0K";

		int length = pass2.length();

		if(length == 2) {
			passCheck = pass2.substring(0 , 1);
		}else {
			passCheck = pass2.substring(0 , length - 1);
		}

		if(pass1.equals(passCheck)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}
