S = input()
print("Yes" if all(s in ["R","U","D"] for s in S[::2]) \
      and all(s in ["L","U","D"] for s in S[1::2]) else "No") S = input() S input() input print("Yes" if all(s in ["R","U","D"] for s in S[::2]) \
      and all(s in ["L","U","D"] for s in S[1::2]) else "No") print "Yes" if all(s in ["R","U","D"] for s in S[::2]) \
      and all(s in ["L","U","D"] for s in S[1::2]) else "No" all(s in ["R","U","D"] for s in S[::2]) \
      and all(s in ["L","U","D"] for s in S[1::2]) all(s in ["R","U","D"] for s in S[::2]) all s in ["R","U","D"] s ["R","U","D"] "R" "U" "D" all(s in ["L","U","D"] for s in S[1::2]) all s in ["L","U","D"] s ["L","U","D"] "L" "U" "D" "Yes" "No" S = input() input() S
S = input()
print("Yes" if all(s in ["R","U","D"] for s in S[::2]) \
      and all(s in ["L","U","D"] for s in S[1::2]) else "No")