program ABC167A
    implicit none
    character(11)::S,T
    read*,S,T
    if(S(1:len_trim(S))==T(1:len_trim(S)))then
        print'(A)',"Yes"
    else
        print'(A)',"No"
    end if
end program ABC167A