get_str(String) :-
 current_input(Input),
 read_string(Input,"\n","",_,String).

tap_even([])    :- writeln("Yes").
tap_even([X|R]) :- (X='L' -> tap_odd(R); (X='U' -> tap_odd(R); (X='D' -> tap_odd(R); writeln("No")))).
tap_odd([])     :- writeln("Yes").
tap_odd([X|R])  :- (X='R' -> tap_even(R); (X='U' -> tap_even(R); (X='D' -> tap_even(R); writeln("No")))).

main :-
 get_str(N),atom_codes(A,N), atom_chars(A,C),tap_odd(C).