program registration
  implicit none
  character(11) :: s, t
  integer :: n
  read(*,*) s
  read(*,*) t
  n = len_trim(s)
  if (s(1:n) == t(1:n)) then
    write(*,'(a)') "Yes"
  else
    write(*,'(a)') "No"
  end if
end program registration