S = list(input())


for i in range(len(S)):
    if i % 2 == 0:
        if S[i] == 'L':
            print("No")
            exit()
    else:
        if 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:
        if S[i] == 'L':
            print("No")
            exit()
    else:
        if S[i] == 'R':
            print("No")
            exit() i range(len(S)) range len(S) len S if i % 2 == 0:
        if S[i] == 'L':
            print("No")
            exit()
    else:
        if S[i] == 'R':
            print("No")
            exit() i % 2 == 0 i % 2 i 2 0 if S[i] == 'L':
            print("No")
            exit()
     S[i] == 'L' S[i] S i 'L' print("No") print "No" exit() exit if S[i] == 'R':
            print("No")
            exit() 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:
        if S[i] == 'L':
            print("No")
            exit()
    else:
        if S[i] == 'R':
            print("No")
            exit()

print("Yes")