s = input()
n = len(s)

for i in range(0, n, 2):
    if s[i] == 'L':
        print('No')
        exit()

for i in range(1, n, 2):
    if s[i] == 'R':
        print('No')
        exit()

print('Yes') s = input() s input() input n = len(s) n len(s) len s for i in range(0, n, 2):
    if s[i] == 'L':
        print('No')
        exit() i range(0, n, 2) range 0 n 2 if s[i] == 'L':
        print('No')
        exit() s[i] == 'L' s[i] s i 'L' print('No') print 'No' exit() exit for i in range(1, n, 2):
    if s[i] == 'R':
        print('No')
        exit() i range(1, n, 2) range 1 n 2 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' n = len(s) len(s) n s = input() input() s
s = input()
n = len(s)

for i in range(0, n, 2):
    if s[i] == 'L':
        print('No')
        exit()

for i in range(1, n, 2):
    if s[i] == 'R':
        print('No')
        exit()

print('Yes')
