import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String T = sc.next();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
} import java.util.Scanner; Scanner 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();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String T = sc.next();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    } main {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String T = sc.next();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("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 String Tmatch=T.substring(0, S.length()); Tmatch T.substring(0, S.length()) T.substring T 0 S.length() S.length S if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        } Tmatch.equals(S) Tmatch.equals Tmatch S {//&& str.equals(lastChar)) {
            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" 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();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("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();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String S = sc.next();
        String T = sc.next();

        //String lastChar = Character.toString(T.charAt(S.length()));

        String Tmatch=T.substring(0, S.length());

        //String str = T.substring(S.length());
        //System.out.println(str);
        if (Tmatch.equals(S) ){//&& str.equals(lastChar)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
        sc.close();
    }
}