S=input()
kisu=["R","U","D"]
gusu=["L","U","D"]


for i in range(len(S)):
	if (i+1)%2==0 and S[i] in gusu:
		continue
	elif (i+1)%2!=0 and S[i] in kisu:
		continue
	else:
		print("No")
		exit()

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


for i in range(len(S)):
	if (i+1)%2==0 and S[i] in gusu:
		continue
	elif (i+1)%2!=0 and S[i] in kisu:
		continue
	else:
		print("No")
		exit()

print("Yes")