S=input()

for s in S[::2]:
    if s=='L':
        print ('No')
        exit()

for s in S[1::2]:
    if s=='R':
        print('No')
        exit()

print('Yes') S=input() S input() input for s in S[::2]:
    if s=='L':
        print ('No')
        exit() s S[::2] S ::2 2 if s=='L':
        print ('No')
        exit() s=='L' s 'L' print ('No') print 'No' exit() exit for s in S[1::2]:
    if s=='R':
        print('No')
        exit() s S[1::2] S 1::2 1 2 if s=='R':
        print('No')
        exit() s=='R' s 'R' print('No') print 'No' exit() exit print('Yes') print 'Yes' S=input() input() S
S=input()

for s in S[::2]:
    if s=='L':
        print ('No')
        exit()

for s in S[1::2]:
    if s=='R':
        print('No')
        exit()

print('Yes')