#include<stdio.h>
#define L 10
int main(){

    char pass[L];
    char new_pass[L+1];

    scanf("%s",&pass);
    scanf("%s", &new_pass);

    for(int i=0;i<L;i++){

        if(pass[i]!=new_pass[i]){
            printf("No\n");
            break;
        }
    }

    printf("Yes\n");
}