import 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();
        sc.close();
        String[] arr1 =  s.split("");
        String[] arr2 =  t.split("");
//        List<String> list1 = Arrays.asList(s.split(""));
        List list1 = new LinkedList(Arrays.asList(s.split("")));
//        List<String> list2 = Arrays.asList(t.split(""));
        List list2 = new LinkedList(Arrays.asList(t.split("")));
//        int num = Integer.parseInt(arr[arr.length - 1]);
        list2.remove(arr2.length - 1);
//        System.out.println(list1);
//        System.out.println(list2);
         if(list1.toString().contentEquals(list2.toString())){
             System.out.println("Yes");
         }else{
             System.out.println("No");
         }
//        switch(num){
//            case 3:
//                System.out.println("bon");
//                break;
//            case 0:
//            case 1:
//            case 6:
//            case 8:
//                System.out.println("pon");
//                break;
//            default:
//                System.out.println("hon");
//                break;
//        }
//        String[] array = str.split(" ");
//        int sum = 0;
//        for(int i=0; i<array.length; i++) {
//            int num = Integer.parseInt(array[i]);
//            sum += num;
//        }
//        System.out.println(15-sum);
    }
}
/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz