S = list(input())

odd = ["R", "U", "D"]
even = ["L", "U", "D"]
ans = "Yes"

for i, s in enumerate(S):
  if i%2==0 and s not in odd:
    ans = "No"
    break
  elif i%2==1 and s not in even:
    ans = "No"
    break

print(ans) S = list(input()) S list(input()) list input() input odd = ["R", "U", "D"] odd ["R", "U", "D"] "R" "U" "D" even = ["L", "U", "D"] even ["L", "U", "D"] "L" "U" "D" ans = "Yes" ans "Yes" for i, s in enumerate(S):
  if i%2==0 and s not in odd:
    ans = "No"
    break
  elif i%2==1 and s not in even:
    ans = "No"
    break i s enumerate(S) enumerate S if i%2==0 and s not in odd:
    ans = "No"
    break
  elif i%2==1 and s not in even:
    ans = "No"
    break i%2==0 and s not in odd i%2==0 i%2 i 2 0 s not in odd s odd ans = "No" ans "No" break elif i%2==1 and s not in even:
    ans = "No"
    break i%2==1 and s not in even i%2==1 i%2 i 2 1 s not in even s even ans = "No" ans "No" break print(ans) print ans ans = "Yes" "Yes" ans S = list(input()) list(input()) S odd = ["R", "U", "D"] ["R", "U", "D"] odd even = ["L", "U", "D"] ["L", "U", "D"] even ans = "No" "No" ans ans = "No" "No" ans
S = list(input())

odd = ["R", "U", "D"]
even = ["L", "U", "D"]
ans = "Yes"

for i, s in enumerate(S):
  if i%2==0 and s not in odd:
    ans = "No"
    break
  elif i%2==1 and s not in even:
    ans = "No"
    break

print(ans)