s = input()
a = 1
f = 0
for i in s:
  if a == 1 and i == "L":
    print("No")
    f = 1
    break
  if a == 0 and i == "R":
    print("No")
    f = 1
    break
  a ^= 1
if f == 0:
  print("Yes") s = input() s input() input a = 1 a 1 f = 0 f 0 for i in s:
  if a == 1 and i == "L":
    print("No")
    f = 1
    break
  if a == 0 and i == "R":
    print("No")
    f = 1
    break
  a ^= 1 i s if a == 1 and i == "L":
    print("No")
    f = 1
    break
   a == 1 and i == "L" a == 1 a 1 i == "L" i "L" print("No") print "No" f = 1 f 1 break if a == 0 and i == "R":
    print("No")
    f = 1
    break
   a == 0 and i == "R" a == 0 a 0 i == "R" i "R" print("No") print "No" f = 1 f 1 break a ^= 1 a 1 if f == 0:
  print("Yes") f == 0 f 0 print("Yes") print "Yes" s = input() input() s a ^= 1 1 a f = 1 1 f a = 1 1 a f = 1 1 f f = 0 0 f
s = input()
a = 1
f = 0
for i in s:
  if a == 1 and i == "L":
    print("No")
    f = 1
    break
  if a == 0 and i == "R":
    print("No")
    f = 1
    break
  a ^= 1
if f == 0:
  print("Yes")