#include<stdio.h>
#include<string.h>
int main()
{
   char s1[10],s2[11];
   gets(s1);
   gets(s2);
   int i=0,c=0;
   while(s1[i] != '\0')
   {
      if(s1[i] != s2[i])
      {
         c = 1;
         break;
      }
      i++;
   }
   if(c == 1)
   {
      printf("No\n");
   }
   else
   {
      printf("Yes\n");
   }
   return 0;
}
