program registration
 
 implicit none
 character::s*10,t*11
 integer::n,i,ans

 read*,s,t
 n=len_trim(s)
 !print*,s,t
 
 ans=0
 do i=1,n
  if(s(i:i)/=t(i:i)) then
   ans=ans+1
   exit 
  end if
 end do

 if(ans==0) print*,'Yes'
 if(ans>0) print*,'No'

end program registration 