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

int main(void){
  char *s, *t;
  s = malloc(sizeof(char*));
  t = malloc(sizeof(char*));
  scanf("%10s", s);
  scanf("%11s", t);
  if(strcmp(s,t) == 0) {
    printf("No");
  } else {
    while(*s == *t) {
      s++;
      t++;
    }
    if(*s == '\0')
      printf("Yes");
    else printf("No");
  }
  return 0;
}

