S = input()
odd_S = S[0::2]
even_S = S[1::2]
if 'L' in odd_S or 'R' in even_S:
    print('No')
else:
    print('Yes')
     S = input() S input() input odd_S = S[0::2] odd_S S[0::2] S 0::2 0 2 even_S = S[1::2] even_S S[1::2] S 1::2 1 2 if 'L' in odd_S or 'R' in even_S:
    print('No')
else:
    print('Yes')
     'L' in odd_S or 'R' in even_S 'L' in odd_S 'L' odd_S 'R' in even_S 'R' even_S print('No') print 'No' print('Yes') print 'Yes' even_S = S[1::2] S[1::2] even_S S = input() input() S odd_S = S[0::2] S[0::2] odd_S
S = input()
odd_S = S[0::2]
even_S = S[1::2]
if 'L' in odd_S or 'R' in even_S:
    print('No')
else:
    print('Yes')
    
