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

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