#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;i++){
	if(n==k+1){
		if(s[i] == t[i] )
			continue;
  		else  
			printf("No");
			break;
		}
 
	else printf("No");
	     break;
}
  