s = input()
n = len(s)


for i in range(n):
    if (i+1)%2 == 0 and s[i] == 'R':
        print('No')
        break
    elif (i+1)%2 == 1 and s[i] == 'L':
        print('No')
        break
else:
    print('Yes') s = input() s input() input n = len(s) n len(s) len s for i in range(n):
    if (i+1)%2 == 0 and s[i] == 'R':
        print('No')
        break
    elif (i+1)%2 == 1 and s[i] == 'L':
        print('No')
        break
else:
    print('Yes') i range(n) range n if (i+1)%2 == 0 and s[i] == 'R':
        print('No')
        break
    elif (i+1)%2 == 1 and s[i] == 'L':
        print('No')
        break (i+1)%2 == 0 and s[i] == 'R' (i+1)%2 == 0 (i+1)%2 i+1 i 1 2 0 s[i] == 'R' s[i] s i 'R' print('No') print 'No' break elif (i+1)%2 == 1 and s[i] == 'L':
        print('No')
        break (i+1)%2 == 1 and s[i] == 'L' (i+1)%2 == 1 (i+1)%2 i+1 i 1 2 1 s[i] == 'L' s[i] s i 'L' print('No') print 'No' break print('Yes') print 'Yes' n = len(s) len(s) n s = input() input() s
s = input()
n = len(s)


for i in range(n):
    if (i+1)%2 == 0 and s[i] == 'R':
        print('No')
        break
    elif (i+1)%2 == 1 and s[i] == 'L':
        print('No')
        break
else:
    print('Yes')