s=eval(input())

flag=0

for i in range(len(s)):

  if i%2==0:

    if s[i]=='L':

      flag+=1

  if i%2==1:

    if s[i]=='R':

      flag+=1

print(('Yes' if flag==0 else 'No'))

      
s = eval(input())

n = len(s)

kisu = ["R", "U", "D"]

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

for i in range(n):

    if i % 2 == 0:

        if s[i] in kisu:

            continue

    else:

        if s[i] in gusu:

            continue

    print("No")

    exit()

print("Yes")

s = eval(input())
flag = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "L":
            flag += 1
    if i % 2 == 1:
        if s[i] == "R":
            flag += 1
print(("Yes" if flag == 0 else "No"))

s = eval(input())
n = len(s)
kisu = ["R", "U", "D"]
gusu = ["L", "U", "D"]
for i in range(n):
    if i % 2 == 0:
        if s[i] in kisu:
            continue
    else:
        if s[i] in gusu:
            continue
    print("No")
    exit()
print("Yes")

-flag = 0 -for i in range(len(s)): +n = len(s) +kisu = ["R", "U", "D"] +gusu = ["L", "U", "D"] +for i in range(n): -        if s[i] == "L": -            flag += 1 -    if i % 2 == 1: -        if s[i] == "R": -            flag += 1 -print(("Yes" if flag == 0 else "No")) +        if s[i] in kisu: +            continue +    else: +        if s[i] in gusu: +            continue +    print("No") +    exit() +print("Yes")