#<B>
S = input()
S1 = S[0::2]
S2 = S[1::2]
ans1 = S1.count("R") + S1.count("U") + S1.count("D")
ans2 = S2.count("L") + S2.count("U") + S2.count("D")
if ans1 == len(S1) and ans2 == len(S2):
    print("Yes")
else:
    print("No") S = input() S input() input S1 = S[0::2] S1 S[0::2] S 0::2 0 2 S2 = S[1::2] S2 S[1::2] S 1::2 1 2 ans1 = S1.count("R") + S1.count("U") + S1.count("D") ans1 S1.count("R") + S1.count("U") + S1.count("D") S1.count("R") + S1.count("U") S1.count("R") S1.count S1 count "R" S1.count("U") S1.count S1 count "U" S1.count("D") S1.count S1 count "D" ans2 = S2.count("L") + S2.count("U") + S2.count("D") ans2 S2.count("L") + S2.count("U") + S2.count("D") S2.count("L") + S2.count("U") S2.count("L") S2.count S2 count "L" S2.count("U") S2.count S2 count "U" S2.count("D") S2.count S2 count "D" if ans1 == len(S1) and ans2 == len(S2):
    print("Yes")
else:
    print("No") ans1 == len(S1) and ans2 == len(S2) ans1 == len(S1) ans1 len(S1) len S1 ans2 == len(S2) ans2 len(S2) len S2 print("Yes") print "Yes" print("No") print "No" S2 = S[1::2] S[1::2] S2 ans2 = S2.count("L") + S2.count("U") + S2.count("D") S2.count("L") + S2.count("U") + S2.count("D") ans2 ans1 = S1.count("R") + S1.count("U") + S1.count("D") S1.count("R") + S1.count("U") + S1.count("D") ans1 S1 = S[0::2] S[0::2] S1 S = input() input() S
#<B>
S = input()
S1 = S[0::2]
S2 = S[1::2]
ans1 = S1.count("R") + S1.count("U") + S1.count("D")
ans2 = S2.count("L") + S2.count("U") + S2.count("D")
if ans1 == len(S1) and ans2 == len(S2):
    print("Yes")
else:
    print("No")