S=list(input())
S_odd=S[::2]
S_even=S[1::2]
flag=1
for i in S_odd:
    if i != "R" and i != "U" and i != "D":
        print("No")
        exit(0)
    for j in S_even:
        if j != "L" and j != "U" and j != "D":
            print("No")
            exit(0)
print("Yes") S=list(input()) S list(input()) list input() input S_odd=S[::2] S_odd S[::2] S ::2 2 S_even=S[1::2] S_even S[1::2] S 1::2 1 2 flag=1 flag 1 for i in S_odd:
    if i != "R" and i != "U" and i != "D":
        print("No")
        exit(0)
    for j in S_even:
        if j != "L" and j != "U" and j != "D":
            print("No")
            exit(0) i S_odd if i != "R" and i != "U" and i != "D":
        print("No")
        exit(0)
     i != "R" and i != "U" and i != "D" i != "R" and i != "U" i != "R" i "R" i != "U" i "U" i != "D" i "D" print("No") print "No" exit(0) exit 0 for j in S_even:
        if j != "L" and j != "U" and j != "D":
            print("No")
            exit(0) j S_even if j != "L" and j != "U" and j != "D":
            print("No")
            exit(0) j != "L" and j != "U" and j != "D" j != "L" and j != "U" j != "L" j "L" j != "U" j "U" j != "D" j "D" print("No") print "No" exit(0) exit 0 print("Yes") print "Yes" S=list(input()) list(input()) S flag=1 1 flag S_odd=S[::2] S[::2] S_odd S_even=S[1::2] S[1::2] S_even
S=list(input())
S_odd=S[::2]
S_even=S[1::2]
flag=1
for i in S_odd:
    if i != "R" and i != "U" and i != "D":
        print("No")
        exit(0)
    for j in S_even:
        if j != "L" and j != "U" and j != "D":
            print("No")
            exit(0)
print("Yes")