program am
    implicit none
    character(12)::S,T
    integer::l
    logical::check=.true.
    read*,S
    read*,T
    l=len_trim(S)
    if(S(1:l)/=T(1:l))check=.false.
    print"(A)",trim(merge("Yes","No ",check))
contains 

end program am