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