#include <stdio.h>
#include <stdlib.h>

int main(){
  int i,n = 0,k = 0;
  char s[10] = {};
  char t[10] = {};
  for(i = 0;i < 10 ;i++){
    scanf("%c", &s[i]);
    ++n;
    if(s[i]=='\n')break;}
  for(i = 0;i < 10;i++){
    scanf("%c", &t[i]);
    ++k;
    if(t[i]=='\n')break;}

  for(i = 0;i < n-1;i++){
	if(k == n+1){
		if(s[i] == t[i] )
			continue;
  		else{
			printf("No");
			exit(1);}
		}
        
	else {
	     printf("No");
	     exit(1);}
	}
	printf("Yes");
}
  