/*
 * FileName:     A
 * CreatedDate:  2020-05-10 22:21:23 +0900
 * LastModified: 2020-05-10 22:26:56 +0900
 */

#include <stdio.h>

int main(void){
    char s[10],t[11];
    scanf("%s",s);
    scanf("%s",t);
    for(int i=0;s[i]!='\0';i++){
        if(s[i]!=t[i]){
            printf("No\n");
            return 0;
        }
    }
    printf("Yes\n");
    return 0;
}
