s = eval(input())

x = sorted(set(s[::2]))

y = sorted(set(s[1::2]))

countx = 0

county = 0

for i in x:

    if i in 'RDU':

        countx += 1

for i in y:

    if i in 'LDU':

        county += 1

print(('Yes' if countx==len(x) and county==len(y) else 'No'))

s=eval(input())

ans='Yes'

for i in range(len(s)):

    if i%2==0:

        if s[i]=='L':

            ans='No'

            break

    else:

        if s[i]=='R':

            ans='No'

            break

print(ans)
s = eval(input())
x = sorted(set(s[::2]))
y = sorted(set(s[1::2]))
countx = 0
county = 0
for i in x:
    if i in "RDU":
        countx += 1
for i in y:
    if i in "LDU":
        county += 1
print(("Yes" if countx == len(x) and county == len(y) else "No"))

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

-x = sorted(set(s[::2])) -y = sorted(set(s[1::2])) -countx = 0 -county = 0 -for i in x: -    if i in "RDU": -        countx += 1 -for i in y: -    if i in "LDU": -        county += 1 -print(("Yes" if countx == len(x) and county == len(y) else "No")) +ans = "Yes" +for i in range(len(s)): +    if i % 2 == 0: +        if s[i] == "L": +            ans = "No" +            break +    else: +        if s[i] == "R": +            ans = "No" +            break +print(ans)