S=input()
x=['R','U','D']
y=['L','U','D']
l=len(S)
for i in range(l):
  if (i+1)%2!=0:
    if S[i]not in x:
      print('No')
      exit()
  else:
    if S[i] not in y:
      print('No')
      exit()

print("Yes") S=input() S input() input x=['R','U','D'] x ['R','U','D'] 'R' 'U' 'D' y=['L','U','D'] y ['L','U','D'] 'L' 'U' 'D' l=len(S) l len(S) len S for i in range(l):
  if (i+1)%2!=0:
    if S[i]not in x:
      print('No')
      exit()
  else:
    if S[i] not in y:
      print('No')
      exit() i range(l) range l if (i+1)%2!=0:
    if S[i]not in x:
      print('No')
      exit()
  else:
    if S[i] not in y:
      print('No')
      exit() (i+1)%2!=0 (i+1)%2 i+1 i 1 2 0 if S[i]not in x:
      print('No')
      exit()
   S[i]not in x S[i] S i x print('No') print 'No' exit() exit if S[i] not in y:
      print('No')
      exit() S[i] not in y S[i] S i y print('No') print 'No' exit() exit print("Yes") print "Yes" S=input() input() S x=['R','U','D'] ['R','U','D'] x l=len(S) len(S) l y=['L','U','D'] ['L','U','D'] y
S=input()
x=['R','U','D']
y=['L','U','D']
l=len(S)
for i in range(l):
  if (i+1)%2!=0:
    if S[i]not in x:
      print('No')
      exit()
  else:
    if S[i] not in y:
      print('No')
      exit()

print("Yes")