import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String a = br.readLine(); a br.readLine() br.readLine br String b = br.readLine(); b br.readLine() br.readLine br int l = Math.min(a.length(), b.length()); l Math.min(a.length(), b.length()) Math.min Math a.length() a.length a b.length() b.length b System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No") System.out.println System.out System System.out a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No" a.substring(0, l).equals(b.subSequence(0, l)) a.substring(0, l).equals a.substring(0, l) a.substring a 0 l b.subSequence(0, l) b.subSequence b 0 l "Yes" "No" String[] args args public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	}
} public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String a = br.readLine();
		String b = br.readLine();
		int l = Math.min(a.length(), b.length());
		System.out.println(a.substring(0, l).equals(b.subSequence(0, l)) ? "Yes" : "No");
	}
}
