li=list(input())
ll=[]
rr=[]
fl=True
for i in li:
  if fl:
    fl=False
    rr.append(i)
    continue
  fl=True
  ll.append(i)
if "L" in rr or "R" in ll:
  print("No")
else:
  print("Yes") li=list(input()) li list(input()) list input() input ll=[] ll [] rr=[] rr [] fl=True fl True for i in li:
  if fl:
    fl=False
    rr.append(i)
    continue
  fl=True
  ll.append(i) i li if fl:
    fl=False
    rr.append(i)
    continue
   fl fl=False fl False rr.append(i) rr.append rr append i continue fl=True fl True ll.append(i) ll.append ll append i if "L" in rr or "R" in ll:
  print("No")
else:
  print("Yes") "L" in rr or "R" in ll "L" in rr "L" rr "R" in ll "R" ll print("No") print "No" print("Yes") print "Yes" fl=False False fl ll=[] [] ll fl=True True fl rr=[] [] rr li=list(input()) list(input()) li fl=True True fl
li=list(input())
ll=[]
rr=[]
fl=True
for i in li:
  if fl:
    fl=False
    rr.append(i)
    continue
  fl=True
  ll.append(i)
if "L" in rr or "R" in ll:
  print("No")
else:
  print("Yes")