S = list(input())
ans = True
for i in range(len(S)):
  if i % 2 != 0:
    if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
  else:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False
if ans:
  print("Yes")
else:
  print("No") S = list(input()) S list(input()) list input() input ans = True ans True for i in range(len(S)):
  if i % 2 != 0:
    if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
  else:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False i range(len(S)) range len(S) len S if i % 2 != 0:
    if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
  else:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False i % 2 != 0 i % 2 i 2 0 if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
   S[i] != "L" and S[i] != "U" and  S[i] != "D" S[i] != "L" and S[i] != "U" S[i] != "L" S[i] S i "L" S[i] != "U" S[i] S i "U" S[i] != "D" S[i] S i "D" ans = False ans False if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False S[i] != "R" and S[i] != "U" and S[i] != "D" S[i] != "R" and S[i] != "U" S[i] != "R" S[i] S i "R" S[i] != "U" S[i] S i "U" S[i] != "D" S[i] S i "D" ans = False ans False if ans:
  print("Yes")
else:
  print("No") ans print("Yes") print "Yes" print("No") print "No" ans = True True ans ans = False False ans S = list(input()) list(input()) S ans = False False ans
S = list(input())
ans = True
for i in range(len(S)):
  if i % 2 != 0:
    if S[i] != "L" and S[i] != "U" and  S[i] != "D":
      ans = False
  else:
    if S[i] != "R" and S[i] != "U" and S[i] != "D":
      ans = False
if ans:
  print("Yes")
else:
  print("No")