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