import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    }

} import java.util.Scanner; Scanner java.util public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    }

} Main public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    } main {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) String S = scan.nextLine(); S scan.nextLine() scan.nextLine scan String T = scan.nextLine(); T scan.nextLine() scan.nextLine scan System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No") System.out.println System.out System System.out S.equals(T.substring(0,S.length())) ? "Yes" : "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 "Yes" "No" scan.close() scan.close scan String[] args args public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    }

} public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    }

} Main
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String S = scan.nextLine();
        String T = scan.nextLine();

        System.out.println(S.equals(T.substring(0,S.length())) ? "Yes" : "No");
        scan.close();
    }

}