#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <inttypes.h>

int main(void){
	char s[10]={'\0'},t[11]={'\0'};
	int slen,tlen;

	scanf("%s\n",s);
	scanf("%s",t);
	slen=strlen(s);
	if(strncmp(s,t,slen)==0){
		printf("Yes");
	}else{
		printf("No");
	}

	return 0;
}
