s = eval(input())



for ss in s[0::2]:

    if ss == 'L':

        print('No')

        exit()



for ss in s[1::2]:

    if ss == 'R':

        print('No')

        exit()



print('Yes')

s = eval(input())



odds = s[0::2]

if 'L' in odds:

    print('No')

    exit()



evens = s[1::2]

if 'R' in evens:

    print('No')

    exit()



print('Yes')

s = eval(input())
for ss in s[0::2]:
    if ss == "L":
        print("No")
        exit()
for ss in s[1::2]:
    if ss == "R":
        print("No")
        exit()
print("Yes")

s = eval(input())
odds = s[0::2]
if "L" in odds:
    print("No")
    exit()
evens = s[1::2]
if "R" in evens:
    print("No")
    exit()
print("Yes")

-for ss in s[0::2]: -    if ss == "L": -        print("No") -        exit() -for ss in s[1::2]: -    if ss == "R": -        print("No") -        exit() +odds = s[0::2] +if "L" in odds: +    print("No") +    exit() +evens = s[1::2] +if "R" in evens: +    print("No") +    exit()