s = input()

for i in range(len(s)) :
    if i % 2 != 0 :
        if s[i] != "L" and s[i] != "U" :
            if s[i] != "D" :
                print("No")
                break
    elif i % 2 == 0 :
        if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break

else :
    print("Yes") s = input() s input() input for i in range(len(s)) :
    if i % 2 != 0 :
        if s[i] != "L" and s[i] != "U" :
            if s[i] != "D" :
                print("No")
                break
    elif i % 2 == 0 :
        if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break

else :
    print("Yes") i range(len(s)) range len(s) len s if i % 2 != 0 :
        if s[i] != "L" and s[i] != "U" :
            if s[i] != "D" :
                print("No")
                break
    elif i % 2 == 0 :
        if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break i % 2 != 0 i % 2 i 2 0 if s[i] != "L" and s[i] != "U" :
            if s[i] != "D" :
                print("No")
                break
     s[i] != "L" and s[i] != "U" s[i] != "L" s[i] s i "L" s[i] != "U" s[i] s i "U" if s[i] != "D" :
                print("No")
                break
     s[i] != "D" s[i] s i "D" print("No") print "No" break elif i % 2 == 0 :
        if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break i % 2 == 0 i % 2 i 2 0 if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break s[i] != "R" and s[i] != "U" s[i] != "R" s[i] s i "R" s[i] != "U" s[i] s i "U" if  s[i] != "D" :
                print("No")
                break s[i] != "D" s[i] s i "D" print("No") print "No" break print("Yes") print "Yes" s = input() input() s
s = input()

for i in range(len(s)) :
    if i % 2 != 0 :
        if s[i] != "L" and s[i] != "U" :
            if s[i] != "D" :
                print("No")
                break
    elif i % 2 == 0 :
        if s[i] != "R" and s[i] != "U" :
            if  s[i] != "D" :
                print("No")
                break

else :
    print("Yes")
