s = list(input())
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "L":
        print("No")
        exit()
    if i % 2 != 0 and s[i] == "R":
        print("No")
        exit()
print("Yes") s = list(input()) s list(input()) list input() input for i in range(len(s)):
    if i % 2 == 0 and s[i] == "L":
        print("No")
        exit()
    if i % 2 != 0 and s[i] == "R":
        print("No")
        exit() i range(len(s)) range len(s) len s if i % 2 == 0 and s[i] == "L":
        print("No")
        exit()
     i % 2 == 0 and s[i] == "L" i % 2 == 0 i % 2 i 2 0 s[i] == "L" s[i] s i "L" print("No") print "No" exit() exit if i % 2 != 0 and s[i] == "R":
        print("No")
        exit() i % 2 != 0 and s[i] == "R" i % 2 != 0 i % 2 i 2 0 s[i] == "R" s[i] s i "R" print("No") print "No" exit() exit print("Yes") print "Yes" s = list(input()) list(input()) s
s = list(input())
for i in range(len(s)):
    if i % 2 == 0 and s[i] == "L":
        print("No")
        exit()
    if i % 2 != 0 and s[i] == "R":
        print("No")
        exit()
print("Yes")