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