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

comp([],[_]).
comp([H1|S],[H1|T]) :- comp(S,T).
    
main :-
  get_string(S),
  get_string(T),
  string_chars(S,L1),
  string_chars(T,L2),
  (comp(L1,L2) -> writeln('Yes');writeln('No')).