S="*"+input()
N=len(S)-1

F=True
for i in range(1,N+1):
    if i%2==1:
        F&=S[i] in {"R","U","D"}
    else:
        F&=S[i] in {"L","U","D"}

if F:
    print("Yes")
else:
    print("No") S="*"+input() S "*"+input() "*" input() input N=len(S)-1 N len(S)-1 len(S) len S 1 F=True F True for i in range(1,N+1):
    if i%2==1:
        F&=S[i] in {"R","U","D"}
    else:
        F&=S[i] in {"L","U","D"} i range(1,N+1) range 1 N+1 N 1 if i%2==1:
        F&=S[i] in {"R","U","D"}
    else:
        F&=S[i] in {"L","U","D"} i%2==1 i%2 i 2 1 F&=S[i] in {"R","U","D"} F S[i] in {"R","U","D"} S[i] S i {"R","U","D"} F&=S[i] in {"L","U","D"} F S[i] in {"L","U","D"} S[i] S i {"L","U","D"} if F:
    print("Yes")
else:
    print("No") F print("Yes") print "Yes" print("No") print "No" F=True True F S="*"+input() "*"+input() S F&=S[i] in {"L","U","D"} S[i] in {"L","U","D"} F N=len(S)-1 len(S)-1 N F&=S[i] in {"R","U","D"} S[i] in {"R","U","D"} F
S="*"+input()
N=len(S)-1

F=True
for i in range(1,N+1):
    if i%2==1:
        F&=S[i] in {"R","U","D"}
    else:
        F&=S[i] in {"L","U","D"}

if F:
    print("Yes")
else:
    print("No")