order = eval(input())

if "R" in order[1::2] or "L" in order[::2]:

  print("No")

else:

  print("Yes")
n = eval(input())

if "L" in  n[::2] or "R" in n[1::2]:

    print("No")

else:

    print("Yes")

order = eval(input())
if "R" in order[1::2] or "L" in order[::2]:
    print("No")
else:
    print("Yes")

n = eval(input())
if "L" in n[::2] or "R" in n[1::2]:
    print("No")
else:
    print("Yes")

-order = eval(input()) -if "R" in order[1::2] or "L" in order[::2]: +n = eval(input()) +if "L" in n[::2] or "R" in n[1::2]: