get_input(Number) :-
    get_string(String),
    number_string(Number, String).

get_string(String) :-
    current_input(Input),
    read_string(Input, ' \n', '', _, String).


f(S,T) :- 
    string_length(S, L),
    substring(T, 1, L, T2),
    S = T2.


main:-
    get_string(S),
    get_string(T),
    f(S,T) -> writeln('Yes') ; writeln('No').
