S = input()

for s in S[0::2]:
  if s not in "RUD":
    print("No")
    exit()

for t in S[1::2]:
  if t not in "LUD":
    print("No")
    exit()
    
print("Yes") S = input() S input() input for s in S[0::2]:
  if s not in "RUD":
    print("No")
    exit() s S[0::2] S 0::2 0 2 if s not in "RUD":
    print("No")
    exit() s not in "RUD" s "RUD" print("No") print "No" exit() exit for t in S[1::2]:
  if t not in "LUD":
    print("No")
    exit()
     t S[1::2] S 1::2 1 2 if t not in "LUD":
    print("No")
    exit()
     t not in "LUD" t "LUD" print("No") print "No" exit() exit print("Yes") print "Yes" S = input() input() S
S = input()

for s in S[0::2]:
  if s not in "RUD":
    print("No")
    exit()

for t in S[1::2]:
  if t not in "LUD":
    print("No")
    exit()
    
print("Yes")