S = list(input())
a = S[::2]
b = S[1::2]

if 'L' in a or 'R' in b:
    print('No')

else:
    print('Yes') S = list(input()) S list(input()) list input() input a = S[::2] a S[::2] S ::2 2 b = S[1::2] b S[1::2] S 1::2 1 2 if 'L' in a or 'R' in b:
    print('No')

else:
    print('Yes') 'L' in a or 'R' in b 'L' in a 'L' a 'R' in b 'R' b print('No') print 'No' print('Yes') print 'Yes' S = list(input()) list(input()) S b = S[1::2] S[1::2] b a = S[::2] S[::2] a
S = list(input())
a = S[::2]
b = S[1::2]

if 'L' in a or 'R' in b:
    print('No')

else:
    print('Yes')
