import java.util.*;

class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        sc = new Scanner(System.in);
        String a = sc.next(),b = sc.next();
        if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No");
    }
}





 import java.util.*; util.* java class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        sc = new Scanner(System.in);
        String a = sc.next(),b = sc.next();
        if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No");
    }
} Main private static Scanner sc; sc public static void main(final String[] args) {
        sc = new Scanner(System.in);
        String a = sc.next(),b = sc.next();
        if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No");
    } main {
        sc = new Scanner(System.in);
        String a = sc.next(),b = sc.next();
        if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No");
    } sc = new Scanner(System.in) sc new Scanner(System.in) String a = sc.next() a sc.next() sc.next sc b = sc.next(); b sc.next() sc.next sc if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No"); a.equals(b.substring(0,a.length())) a.equals a b.substring(0,a.length()) b.substring b 0 a.length() a.length a System.out.println("Yes") System.out.println System.out System System.out "Yes" System.out.println("No") System.out.println System.out System System.out "No" final String[] args args
import java.util.*;

class Main {
    private static Scanner sc;

    public static void main(final String[] args) {
        sc = new Scanner(System.in);
        String a = sc.next(),b = sc.next();
        if(a.equals(b.substring(0,a.length()))) System.out.println("Yes");
        else System.out.println("No");
    }
}






