s=eval(input())

n=len(s)

ans=0

for i in range(0,n,2):

    if s[i]=='L':

        ans+=1

for i in range(1,n,2):

    if s[i]=='R':

        ans+=1

if ans==0:

    print('Yes')

else:

    print('No')
s=eval(input())

n=len(s)

ans=True

for i in range(0,n,2):

    if s[i]=='L':

        ans=False

for i in range(1,n,2):

    if s[i]=='R':

        ans=False

if ans:

    print('Yes')

else:

    print('No')

s = eval(input())
n = len(s)
ans = 0
for i in range(0, n, 2):
    if s[i] == "L":
        ans += 1
for i in range(1, n, 2):
    if s[i] == "R":
        ans += 1
if ans == 0:
    print("Yes")
else:
    print("No")

s = eval(input())
n = len(s)
ans = True
for i in range(0, n, 2):
    if s[i] == "L":
        ans = False
for i in range(1, n, 2):
    if s[i] == "R":
        ans = False
if ans:
    print("Yes")
else:
    print("No")

-ans = 0 +ans = True -        ans += 1 +        ans = False -        ans += 1 -if ans == 0: +        ans = False +if ans: