   program abc167a
      implicit none
      character(10)::s,t
      integer::i

         read *, s
         read *, t

         i=len_trim(s)
         if (s(1:i)==t(1:i)) then
            print *, 'Yes'
         else
            print *, 'No'
         end if

   end program abc167a