# B Tap Dance
s = input()
S = len(s)
for i in range(S):
    if i % 2:  # 奇数
        if s[i] == "R":
            print("No")
            exit()
    else:
        if s[i]  == "L":
            print("No")
            exit()
print("Yes") s = input() s input() input S = len(s) S len(s) len s for i in range(S):
    if i % 2:  # 奇数
        if s[i] == "R":
            print("No")
            exit()
    else:
        if s[i]  == "L":
            print("No")
            exit() i range(S) range S if i % 2:  # 奇数
        if s[i] == "R":
            print("No")
            exit()
    else:
        if s[i]  == "L":
            print("No")
            exit() i % 2 i 2 if s[i] == "R":
            print("No")
            exit()
     s[i] == "R" s[i] s i "R" print("No") print "No" exit() exit if s[i]  == "L":
            print("No")
            exit() s[i]  == "L" s[i] s i "L" print("No") print "No" exit() exit print("Yes") print "Yes" s = input() input() s S = len(s) len(s) S
# B Tap Dance
s = input()
S = len(s)
for i in range(S):
    if i % 2:  # 奇数
        if s[i] == "R":
            print("No")
            exit()
    else:
        if s[i]  == "L":
            print("No")
            exit()
print("Yes")