import re

S=eval(input())

print(("NYoe s"[len(re.sub("[RUD]",'',S[0::2]))==0==len(re.sub("[LUD]",'',S[1::2]))::2]))
S=eval(input())

print(("YNeos"["L" in S[0::2] or "R" in S[1::2]::2]))
import re

S = eval(input())
print(
    (
        "NYoe s"[
            len(re.sub("[RUD]", "", S[0::2]))
            == 0
            == len(re.sub("[LUD]", "", S[1::2])) :: 2
        ]
    )
)

S = eval(input())
print(("YNeos"["L" in S[0::2] or "R" in S[1::2] :: 2]))

-import re - -print( -    ( -        "NYoe s"[ -            len(re.sub("[RUD]", "", S[0::2])) -            == 0 -            == len(re.sub("[LUD]", "", S[1::2])) :: 2 -        ] -    ) -) +print(("YNeos"["L" in S[0::2] or "R" in S[1::2] :: 2]))