#include<stdio.h>
#define L 10
int main(){
  int pass[L];
  int new_pass[L+1];
  
  scanf("%s",&pass);
  scanf("%s",&new_pass);
  
  for(int i=0;i<L+1;i++){
    if(pass[i]!=new_pass[i]){
      printf("No\n");
      break;
    }
  }
  printf("Yes\n");
  return 0;
}