S = input()
So = S[0::2]
Se = S[1::2]
if 'L' in So:
	print('No')
elif 'R' in Se:
	print('No')
else:
	print('Yes') S = input() S input() input So = S[0::2] So S[0::2] S 0::2 0 2 Se = S[1::2] Se S[1::2] S 1::2 1 2 if 'L' in So:
	print('No')
elif 'R' in Se:
	print('No')
else:
	print('Yes') 'L' in So 'L' So print('No') print 'No' elif 'R' in Se:
	print('No') 'R' in Se 'R' Se print('No') print 'No' print('Yes') print 'Yes' S = input() input() S So = S[0::2] S[0::2] So Se = S[1::2] S[1::2] Se
S = input()
So = S[0::2]
Se = S[1::2]
if 'L' in So:
	print('No')
elif 'R' in Se:
	print('No')
else:
	print('Yes')
