import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc String t = sc.next(); t sc.next() sc.next sc System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No") System.out.println System.out System System.out s.equals(t.substring(0, s.length())) ? "Yes" : "No" s.equals(t.substring(0, s.length())) s.equals s t.substring(0, s.length()) t.substring t 0 s.length() s.length s "Yes" "No" sc.close() sc.close sc String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 文字列の入力
		String s = sc.next();
		String t = sc.next();

		// 出力
		System.out.println(s.equals(t.substring(0, s.length())) ? "Yes" : "No");
		sc.close();
	}
}
