S = eval(input())



S1 = S[0::2]

S2 = S[1::2]



if ("R" in S2) or ("L" in S1):

    print("No")

else:

    print("Yes")
#input

S = eval(input())



#output

if ("L" in S[0::2]) or ("R" in S[1::2]):

    print("No")

else:

    print("Yes")
S = eval(input())
S1 = S[0::2]
S2 = S[1::2]
if ("R" in S2) or ("L" in S1):
    print("No")
else:
    print("Yes")

# input
S = eval(input())
# output
if ("L" in S[0::2]) or ("R" in S[1::2]):
    print("No")
else:
    print("Yes")

+# input -S1 = S[0::2] -S2 = S[1::2] -if ("R" in S2) or ("L" in S1): +# output +if ("L" in S[0::2]) or ("R" in S[1::2]):