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