# Written by Shagoto

s = eval(input())

i = 0

check = True

while(i < len(s)):

    if(i % 2 == 0 and s[i] == "L"):

        check = False

        break

    elif(i % 2 == 1 and s[i] == "R"):

        check = False

        break

    i += 1



if(check):

    print("Yes")

else:

    print("No")
s=eval(input())

i=0

flag=0

while i<len(s):

    if (i+1)%2==0:

        if s[i] =="L" or s[i] =="U" or s[i] =="D":

            pass

        else:

            flag+=1

         

    else:

        if s[i] =="R" or s[i] =="U" or s[i] =="D":

            pass

        else:

            flag+=1

     



    if flag==1:

        break





    i+=1



if flag==1:

    print("No")

else:

    print("Yes")
# Written by Shagoto
s = eval(input())
i = 0
check = True
while i < len(s):
    if i % 2 == 0 and s[i] == "L":
        check = False
        break
    elif i % 2 == 1 and s[i] == "R":
        check = False
        break
    i += 1
if check:
    print("Yes")
else:
    print("No")

s = eval(input())
i = 0
flag = 0
while i < len(s):
    if (i + 1) % 2 == 0:
        if s[i] == "L" or s[i] == "U" or s[i] == "D":
            pass
        else:
            flag += 1
    else:
        if s[i] == "R" or s[i] == "U" or s[i] == "D":
            pass
        else:
            flag += 1
    if flag == 1:
        break
    i += 1
if flag == 1:
    print("No")
else:
    print("Yes")

-# Written by Shagoto -check = True +flag = 0 -    if i % 2 == 0 and s[i] == "L": -        check = False -        break -    elif i % 2 == 1 and s[i] == "R": -        check = False +    if (i + 1) % 2 == 0: +        if s[i] == "L" or s[i] == "U" or s[i] == "D": +            pass +        else: +            flag += 1 +    else: +        if s[i] == "R" or s[i] == "U" or s[i] == "D": +            pass +        else: +            flag += 1 +    if flag == 1: -if check: +if flag == 1: +    print("No") +else: -else: -    print("No")