//package Beg_167;
import java.util.*;

public class Main{
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	}
} import java.util.*; util.* java public class Main{
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	}
} Main public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	} main {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	} Scanner a = new Scanner(System.in); a new Scanner(System.in) String s1 = a.nextLine(); s1 a.nextLine() a.nextLine a String s2=a.nextLine(); s2 a.nextLine() a.nextLine a if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		} (s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1)) (s1.substring(0,s1.length()-1).equals(s2)) s1.substring(0,s1.length()-1).equals s1.substring(0,s1.length()-1) s1.substring s1 0 s1.length()-1 s1.length() s1.length s1 1 s2 (s2.substring(0,s2.length()-1).equals(s1)) s2.substring(0,s2.length()-1).equals s2.substring(0,s2.length()-1) s2.substring s2 0 s2.length()-1 s2.length() s2.length s2 1 s1 {
			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" a.close() a.close a String[] args args public class Main{
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	}
} public class Main{
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	}
} Main
//package Beg_167;
import java.util.*;

public class Main{
	public static void main(String[] args) {
		Scanner a = new Scanner(System.in);
		String s1 = a.nextLine();
		String s2=a.nextLine();
		if ((s1.substring(0,s1.length()-1).equals(s2)) || (s2.substring(0,s2.length()-1).equals(s1))) {
			System.out.println("Yes");
		}
		else {
			System.out.println("No");
		}
		
a.close();
	}
}