S = input()
N = len(S)
for i in range(N):
    if (i + 1) % 2 == 1:
        if S[i] in ("R", "U", "D"):
            continue
        else:
            print("No")
            exit()
    else:
        if S[i] in ("L", "U", "D"):
            continue
        else:
            print("No")
            exit()
print("Yes") S = input() S input() input N = len(S) N len(S) len S for i in range(N):
    if (i + 1) % 2 == 1:
        if S[i] in ("R", "U", "D"):
            continue
        else:
            print("No")
            exit()
    else:
        if S[i] in ("L", "U", "D"):
            continue
        else:
            print("No")
            exit() i range(N) range N if (i + 1) % 2 == 1:
        if S[i] in ("R", "U", "D"):
            continue
        else:
            print("No")
            exit()
    else:
        if S[i] in ("L", "U", "D"):
            continue
        else:
            print("No")
            exit() (i + 1) % 2 == 1 (i + 1) % 2 i + 1 i 1 2 1 if S[i] in ("R", "U", "D"):
            continue
        else:
            print("No")
            exit()
     S[i] in ("R", "U", "D") S[i] S i ("R", "U", "D") "R" "U" "D" continue print("No") print "No" exit() exit if S[i] in ("L", "U", "D"):
            continue
        else:
            print("No")
            exit() S[i] in ("L", "U", "D") S[i] S i ("L", "U", "D") "L" "U" "D" continue print("No") print "No" exit() exit print("Yes") print "Yes" N = len(S) len(S) N S = input() input() S
S = input()
N = len(S)
for i in range(N):
    if (i + 1) % 2 == 1:
        if S[i] in ("R", "U", "D"):
            continue
        else:
            print("No")
            exit()
    else:
        if S[i] in ("L", "U", "D"):
            continue
        else:
            print("No")
            exit()
print("Yes")
