s = input()

sa = s[::2]
sb = s[1::2]

for i in sa:
  if i == "L":
    print("No")
    exit()

for j in sb:
  if j == "R":
    print("No")
    exit()
print("Yes") s = input() s input() input sa = s[::2] sa s[::2] s ::2 2 sb = s[1::2] sb s[1::2] s 1::2 1 2 for i in sa:
  if i == "L":
    print("No")
    exit() i sa if i == "L":
    print("No")
    exit() i == "L" i "L" print("No") print "No" exit() exit for j in sb:
  if j == "R":
    print("No")
    exit() j sb if j == "R":
    print("No")
    exit() j == "R" j "R" print("No") print "No" exit() exit print("Yes") print "Yes" sb = s[1::2] s[1::2] sb s = input() input() s sa = s[::2] s[::2] sa
s = input()

sa = s[::2]
sb = s[1::2]

for i in sa:
  if i == "L":
    print("No")
    exit()

for j in sb:
  if j == "R":
    print("No")
    exit()
print("Yes")