s=input()
o=["R","U","D"]
e=["L","U","D"]
for i in range(len(s)):
  if i%2==0:
    if s[i] in o:
      pass
    else:
      print("No")
      break
  else:
    if s[i] in e:
      pass
    else:
      print("No")
      break
else:
  print("Yes") s=input() s input() input o=["R","U","D"] o ["R","U","D"] "R" "U" "D" e=["L","U","D"] e ["L","U","D"] "L" "U" "D" for i in range(len(s)):
  if i%2==0:
    if s[i] in o:
      pass
    else:
      print("No")
      break
  else:
    if s[i] in e:
      pass
    else:
      print("No")
      break
else:
  print("Yes") i range(len(s)) range len(s) len s if i%2==0:
    if s[i] in o:
      pass
    else:
      print("No")
      break
  else:
    if s[i] in e:
      pass
    else:
      print("No")
      break i%2==0 i%2 i 2 0 if s[i] in o:
      pass
    else:
      print("No")
      break
   s[i] in o s[i] s i o print("No") print "No" break if s[i] in e:
      pass
    else:
      print("No")
      break s[i] in e s[i] s i e print("No") print "No" break print("Yes") print "Yes" o=["R","U","D"] ["R","U","D"] o e=["L","U","D"] ["L","U","D"] e s=input() input() s
s=input()
o=["R","U","D"]
e=["L","U","D"]
for i in range(len(s)):
  if i%2==0:
    if s[i] in o:
      pass
    else:
      print("No")
      break
  else:
    if s[i] in e:
      pass
    else:
      print("No")
      break
else:
  print("Yes")