class Main {
	public static void main(String[] args) {
      	java.util.Scanner input = new java.util.Scanner(System.in);
      	String S = input.nextLine();
      	String T = input.nextLine();
    	 new Main().solve(S, T);
    }
  	private void solve(String s, String t) {
      if(s.length() >= t.length())
        System.out.print("No");
    	 if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("No");
    }
} class Main {
	public static void main(String[] args) {
      	java.util.Scanner input = new java.util.Scanner(System.in);
      	String S = input.nextLine();
      	String T = input.nextLine();
    	 new Main().solve(S, T);
    }
  	private void solve(String s, String t) {
      if(s.length() >= t.length())
        System.out.print("No");
    	 if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("No");
    }
} Main public static void main(String[] args) {
      	java.util.Scanner input = new java.util.Scanner(System.in);
      	String S = input.nextLine();
      	String T = input.nextLine();
    	 new Main().solve(S, T);
    } main {
      	java.util.Scanner input = new java.util.Scanner(System.in);
      	String S = input.nextLine();
      	String T = input.nextLine();
    	 new Main().solve(S, T);
    } java.util.Scanner input = new java.util.Scanner(System.in); input new java.util.Scanner(System.in) String S = input.nextLine(); S input.nextLine() input.nextLine input String T = input.nextLine(); T input.nextLine() input.nextLine input new Main().solve(S, T) new Main().solve new Main() S T String[] args args private void solve(String s, String t) {
      if(s.length() >= t.length())
        System.out.print("No");
    	 if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("No");
    } solve {
      if(s.length() >= t.length())
        System.out.print("No");
    	 if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("No");
    } if(s.length() >= t.length())
        System.out.print("No"); s.length() >= t.length() s.length() s.length s t.length() t.length t System.out.print("No") System.out.print System.out System System.out "No" if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("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 System.out.print("Yes") System.out.print System.out System System.out "Yes" System.out.print("No") System.out.print System.out System System.out "No" String s s String t t
class Main {
	public static void main(String[] args) {
      	java.util.Scanner input = new java.util.Scanner(System.in);
      	String S = input.nextLine();
      	String T = input.nextLine();
    	 new Main().solve(S, T);
    }
  	private void solve(String s, String t) {
      if(s.length() >= t.length())
        System.out.print("No");
    	 if(s.equals(t.substring(0, s.length())))
          System.out.print("Yes");
        else
          System.out.print("No");
    }
}