S = input()

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

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

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

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

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

print("Yes")