S=input()
L={'U','D','L'}
R={'U','D','R'}
for i in range(len(S)):
  if i%2==0:
    if not S[i] in R:
      print('No')
      exit()
  else:
    if not S[i] in L:
      print('No')
      exit()
else:
  print('Yes') S=input() S input() input L={'U','D','L'} L {'U','D','L'} R={'U','D','R'} R {'U','D','R'} for i in range(len(S)):
  if i%2==0:
    if not S[i] in R:
      print('No')
      exit()
  else:
    if not S[i] in L:
      print('No')
      exit()
else:
  print('Yes') i range(len(S)) range len(S) len S if i%2==0:
    if not S[i] in R:
      print('No')
      exit()
  else:
    if not S[i] in L:
      print('No')
      exit() i%2==0 i%2 i 2 0 if not S[i] in R:
      print('No')
      exit()
   not S[i] in R S[i] in R S[i] S i R print('No') print 'No' exit() exit if not S[i] in L:
      print('No')
      exit() not S[i] in L S[i] in L S[i] S i L print('No') print 'No' exit() exit print('Yes') print 'Yes' R={'U','D','R'} {'U','D','R'} R L={'U','D','L'} {'U','D','L'} L S=input() input() S
S=input()
L={'U','D','L'}
R={'U','D','R'}
for i in range(len(S)):
  if i%2==0:
    if not S[i] in R:
      print('No')
      exit()
  else:
    if not S[i] in L:
      print('No')
      exit()
else:
  print('Yes')