S = input()
N = len(S)
for i in range(N):
    if i%2==0:
        if not(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            print("No")
            break

    else:
        if not (S[i]=="L" or S[i]=="U" or S[i]=="D"):
            print("No")
            break
else:
    print("Yes") S = input() S input() input N = len(S) N len(S) len S for i in range(N):
    if i%2==0:
        if not(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            print("No")
            break

    else:
        if not (S[i]=="L" or S[i]=="U" or S[i]=="D"):
            print("No")
            break
else:
    print("Yes") i range(N) range N if i%2==0:
        if not(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            print("No")
            break

    else:
        if not (S[i]=="L" or S[i]=="U" or S[i]=="D"):
            print("No")
            break i%2==0 i%2 i 2 0 if not(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            print("No")
            break

     not(S[i]=="R" or S[i]=="U" or S[i]=="D") S[i]=="R" or S[i]=="U" or S[i]=="D" S[i]=="R" or 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" print("No") print "No" break if not (S[i]=="L" or S[i]=="U" or S[i]=="D"):
            print("No")
            break not (S[i]=="L" or S[i]=="U" or S[i]=="D") S[i]=="L" or S[i]=="U" or S[i]=="D" S[i]=="L" or 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" print("No") print "No" break print("Yes") print "Yes" S = input() input() S N = len(S) len(S) N
S = input()
N = len(S)
for i in range(N):
    if i%2==0:
        if not(S[i]=="R" or S[i]=="U" or S[i]=="D"):
            print("No")
            break

    else:
        if not (S[i]=="L" or S[i]=="U" or S[i]=="D"):
            print("No")
            break
else:
    print("Yes")