s = input()
odd = s[::2]
even = s[1::2]
if 'L'  in odd or 'R'  in even:
    print('No')
else:
    print('Yes') s = input() s input() input odd = s[::2] odd s[::2] s ::2 2 even = s[1::2] even s[1::2] s 1::2 1 2 if 'L'  in odd or 'R'  in even:
    print('No')
else:
    print('Yes') 'L'  in odd or 'R'  in even 'L'  in odd 'L' odd 'R'  in even 'R' even print('No') print 'No' print('Yes') print 'Yes' odd = s[::2] s[::2] odd s = input() input() s even = s[1::2] s[1::2] even
s = input()
odd = s[::2]
even = s[1::2]
if 'L'  in odd or 'R'  in even:
    print('No')
else:
    print('Yes')