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

int main(void) {
   char s[10], t[11];
   int count = 0;
   
   scanf("%s %s", s, t);

   int x = strlen(s);
   int y = strlen(t);
   
   for(int i = 0; i < x; i++){
       if(s[i] == t[i]){
          count++;
       }
   }
   if(count != y){
      printf("No\n");
   }else if(y+1 == x){
      printf("Yes\n");
   }
   return 0;
}
