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