program main
    implicit none
    character(10) a,b,c
    integer k
    read(*,*) a,b
    k=len_trim(a)
    c=b(1:k)
    c=trim(c)
    if(c==a) then
        write(*,*) 'Yes'
    else
        write(*,*) 'No'
    end if
end program main
 

