#include <stdio.h>

int main(void){
    char S[10+2];
    char T[10+3];

    fgets(S, sizeof(S), stdin);
    fgets(T, sizeof(T), stdin);
    
    int i = 0;
    while(S[i] != '\n'){
        if(S[i] != T[i]){
            break;
        }
        i++;
    }

    if(S[i] == '\n'){
        printf("Yes\n");
    }else{
        printf("No\n");
    }

    return 0;
}
