s=input()
o="RUD"
e="LUD"
for i in range(0,len(s),2):
    if s[i] not in o:
        print("No")
        exit()
for i in range(1,len(s),2):
    if s[i] not in e:
        print("No")
        exit()
print("Yes") s=input() s input() input o="RUD" o "RUD" e="LUD" e "LUD" for i in range(0,len(s),2):
    if s[i] not in o:
        print("No")
        exit() i range(0,len(s),2) range 0 len(s) len s 2 if s[i] not in o:
        print("No")
        exit() s[i] not in o s[i] s i o print("No") print "No" exit() exit for i in range(1,len(s),2):
    if s[i] not in e:
        print("No")
        exit() i range(1,len(s),2) range 1 len(s) len s 2 if s[i] not in e:
        print("No")
        exit() s[i] not in e s[i] s i e print("No") print "No" exit() exit print("Yes") print "Yes" s=input() input() s e="LUD" "LUD" e o="RUD" "RUD" o
s=input()
o="RUD"
e="LUD"
for i in range(0,len(s),2):
    if s[i] not in o:
        print("No")
        exit()
for i in range(1,len(s),2):
    if s[i] not in e:
        print("No")
        exit()
print("Yes")