#include<stdio.h>

int main()
{
   char s1[20], s2[20];
   scanf("%s\n%s", s1, s2);

   for (int i = 0; s1[i]; ++i)
   {
      if(s1[i]!=s2[i]){
         printf("NO\n");
         return 0;
      }
   }
   printf("YES\n");

   return 0;
}

