S = input()
result = False
for s in S[::2]:
  if s not in 'RUD':
    break
else:
  for s in S[1::2]:
    if s not in 'LUD':
      break
  else:
    result = True
print('Yes' if result else 'No')   S = input() S input() input result = False result False for s in S[::2]:
  if s not in 'RUD':
    break
else:
  for s in S[1::2]:
    if s not in 'LUD':
      break
  else:
    result = True s S[::2] S ::2 2 if s not in 'RUD':
    break s not in 'RUD' s 'RUD' break for s in S[1::2]:
    if s not in 'LUD':
      break
  else:
    result = True s S[1::2] S 1::2 1 2 if s not in 'LUD':
      break
   s not in 'LUD' s 'LUD' break result = True result True print('Yes' if result else 'No') print 'Yes' if result else 'No' result 'Yes' 'No' result = True True result S = input() input() S result = False False result
S = input()
result = False
for s in S[::2]:
  if s not in 'RUD':
    break
else:
  for s in S[1::2]:
    if s not in 'LUD':
      break
  else:
    result = True
print('Yes' if result else 'No')  