s = eval(input())

d = {}

d[0] = ["R", "U", "D"]

d[1] = ["L", "U", "D"]

res = True

for i in range(len(s)):

    if s[i] not in d[i%2]:

        res = False



print(("Yes" if res  else "No"))
a = ["R", "U", "D"]

b = ["L", "U", "D"]

s = eval(input())

iscan = True

for i in range(len(s)):

    if i%2 == 0:

        if s[i] not in a:

            iscan = False

    else:

        if s[i] not in b:

            iscan = False

print(("Yes" if iscan else "No"))

s = eval(input())
d = {}
d[0] = ["R", "U", "D"]
d[1] = ["L", "U", "D"]
res = True
for i in range(len(s)):
    if s[i] not in d[i % 2]:
        res = False
print(("Yes" if res else "No"))

a = ["R", "U", "D"]
b = ["L", "U", "D"]
s = eval(input())
iscan = True
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] not in a:
            iscan = False
    else:
        if s[i] not in b:
            iscan = False
print(("Yes" if iscan else "No"))

+a = ["R", "U", "D"] +b = ["L", "U", "D"] -d = {} -d[0] = ["R", "U", "D"] -d[1] = ["L", "U", "D"] -res = True +iscan = True -    if s[i] not in d[i % 2]: -        res = False -print(("Yes" if res else "No")) +    if i % 2 == 0: +        if s[i] not in a: +            iscan = False +    else: +        if s[i] not in b: +            iscan = False +print(("Yes" if iscan else "No"))