import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

  static String s, t;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  }
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.io.PrintWriter; PrintWriter java.io public class Main {

  static String s, t;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  }
} Main static String s s t; t public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  } main {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  } BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) PrintWriter out = new PrintWriter(System.out); out new PrintWriter(System.out) s = br.readLine() s br.readLine() br.readLine br t = br.readLine() t br.readLine() br.readLine br br.close() br.close br boolean flag = true; flag true int n = s.length(); n s.length() s.length s int m = t.length(); m t.length() t.length t flag = s.equals(t.substring(0, n)) flag s.equals(t.substring(0, n)) s.equals s t.substring(0, n) t.substring t 0 n out.println(flag ? "Yes" : "No") out.println out flag ? "Yes" : "No" flag "Yes" "No" out.flush() out.flush out String[] args args public class Main {

  static String s, t;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  }
} public class Main {

  static String s, t;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  }
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.PrintWriter;

public class Main {

  static String s, t;

  public static void main(String[] args) throws Exception {

    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    PrintWriter out = new PrintWriter(System.out);

    //String[] in = br.readLine().split(" ");
    s = br.readLine();
    t = br.readLine();

    /*
    =====templates=====
    ===inputs===
    static int n;
    in = br.readLine().split(" ");
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    int n = Integer.parseInt(in[0]);
    long n = Long.parseLong(in[0]);
    int[] a = Stream.of(in).mapToInt(Integer::parseInt).toArray();

    ===outputs===
    PrintWriter out = new PrintWriter(System.out);
    out.println(ans);
    out.flush();
    */

    br.close();

    boolean flag = true;
    int n = s.length();
    int m = t.length();

    flag = s.equals(t.substring(0, n));

    out.println(flag ? "Yes" : "No");

    out.flush();

  }
}