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