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

int main(void){
   int n = 10;
   int count = 0;
   char s[n];
   char t[n+1];

   scanf("%s %s",s,t);

   for(int i=0;i<strlen(s);i++){
      if(s[i] == t[i]){
         count++;
      }
      if(count == strlen(s)){
         printf("YES\n");
      } else {
         printf("NO\n");
      }
   }
   return 0;
}
      
