S = input()
for i in range(len(S)+1):
  if i == len(S):
    print('Yes')
    break
  if S[i] =='U' or S[i] =='D':
    pass
  else:
    if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
     S = input() S input() input for i in range(len(S)+1):
  if i == len(S):
    print('Yes')
    break
  if S[i] =='U' or S[i] =='D':
    pass
  else:
    if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
     i range(len(S)+1) range len(S)+1 len(S) len S 1 if i == len(S):
    print('Yes')
    break
   i == len(S) i len(S) len S print('Yes') print 'Yes' break if S[i] =='U' or S[i] =='D':
    pass
  else:
    if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
     S[i] =='U' or S[i] =='D' S[i] =='U' S[i] S i 'U' S[i] =='D' S[i] S i 'D' if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
     i % 2 ==0 i % 2 i 2 0 if S[i] == 'R':
        pass
      else:
        print('No')
        break
     S[i] == 'R' S[i] S i 'R' print('No') print 'No' break if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
     S[i]== 'L' S[i] S i 'L' print('No') print 'No' break S = input() input() S
S = input()
for i in range(len(S)+1):
  if i == len(S):
    print('Yes')
    break
  if S[i] =='U' or S[i] =='D':
    pass
  else:
    if i % 2 ==0:
      if S[i] == 'R':
        pass
      else:
        print('No')
        break
    else:
      if S[i]== 'L':
        pass
      else:
        print('No')
        break
        
      
    
