#include<stdio.h>
#include<string.h>

int main(){
  char s[15],s2[15];
  scanf("%s %s",s,s2);
  
  for (int i=0;i<strlen(s);i++){
    if(s[i]!=s2[i]) printf("No");
    return 0;
  }
  
  printf("Yes");
  
  return 0;
}

  