import java.util.Scanner;
 
class Main{
 
    public static void main(String[] args){
 
        Scanner scanner = new Scanner(System.in);
        String val1 = scanner.next();
        String val2 = scanner.next();
        scanner.close();
        String check = val2.substring(0, val1.length());
        if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
 
} import java.util.Scanner; Scanner java.util class Main{
 
    public static void main(String[] args){
 
        Scanner scanner = new Scanner(System.in);
        String val1 = scanner.next();
        String val2 = scanner.next();
        scanner.close();
        String check = val2.substring(0, val1.length());
        if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
 
} Main public static void main(String[] args){
 
        Scanner scanner = new Scanner(System.in);
        String val1 = scanner.next();
        String val2 = scanner.next();
        scanner.close();
        String check = val2.substring(0, val1.length());
        if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } main {
 
        Scanner scanner = new Scanner(System.in);
        String val1 = scanner.next();
        String val2 = scanner.next();
        scanner.close();
        String check = val2.substring(0, val1.length());
        if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) String val1 = scanner.next(); val1 scanner.next() scanner.next scanner String val2 = scanner.next(); val2 scanner.next() scanner.next scanner scanner.close() scanner.close scanner String check = val2.substring(0, val1.length()); check val2.substring(0, val1.length()) val2.substring val2 0 val1.length() val1.length val1 if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        } check.equals(val1) check.equals check val1 {
            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" String[] args args
import java.util.Scanner;
 
class Main{
 
    public static void main(String[] args){
 
        Scanner scanner = new Scanner(System.in);
        String val1 = scanner.next();
        String val2 = scanner.next();
        scanner.close();
        String check = val2.substring(0, val1.length());
        if(check.equals(val1)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
 
}