#include <stdio.h>
int main(void){
	char s[11] = { '\0' };
	char t[12] = { '\0' };
	scanf("%s", s);
	scanf("%s", t);
	int i = 0;
	int flg = 1;
	while(s[i] != '\0'){
		if(s[i] != t[i]){
			flg = 0;
			break;
		}
		i++;
	}
	if(flg == 1){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}