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

int main(void){
  	char line1[20],line2[21];
  
 	scanf("%s",line1);
  	scanf("%s",line2);
  
  	int n = strlen(line1);
  	int count = 0;
  	
  	for(int i = 0;n - 1;i ++){
     	if(line1[i] == line2[i]){
         	count ++; 
        }
    }
  
  	if(count == n-1){
     	printf("Yes"); 
    }else{
     	printf("No"); 
    }
  	return 0;
}