S = str(input())
 
Ans = True
for i in range(0, len(S)):
  if (i + 1) % 2 == 0:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  if (i + 1) % 2 == 1:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  
if Ans == False:
  print('No')
else:
  print('Yes') S = str(input()) S str(input()) str input() input Ans = True Ans True for i in range(0, len(S)):
  if (i + 1) % 2 == 0:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  if (i + 1) % 2 == 1:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
   i range(0, len(S)) range 0 len(S) len S if (i + 1) % 2 == 0:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
   (i + 1) % 2 == 0 (i + 1) % 2 i + 1 i 1 2 0 if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
   S[i] != 'L' and S[i] != 'U' and S[i] != 'D' S[i] != 'L' and S[i] != 'U' S[i] != 'L' S[i] S i 'L' S[i] != 'U' S[i] S i 'U' S[i] != 'D' S[i] S i 'D' Ans = False Ans False break if (i + 1) % 2 == 1:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
   (i + 1) % 2 == 1 (i + 1) % 2 i + 1 i 1 2 1 if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
   S[i] != 'R' and S[i] != 'U' and S[i] != 'D' S[i] != 'R' and S[i] != 'U' S[i] != 'R' S[i] S i 'R' S[i] != 'U' S[i] S i 'U' S[i] != 'D' S[i] S i 'D' Ans = False Ans False break if Ans == False:
  print('No')
else:
  print('Yes') Ans == False Ans False print('No') print 'No' print('Yes') print 'Yes' Ans = False False Ans S = str(input()) str(input()) S Ans = True True Ans Ans = False False Ans
S = str(input())
 
Ans = True
for i in range(0, len(S)):
  if (i + 1) % 2 == 0:
    if S[i] != 'L' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  if (i + 1) % 2 == 1:
    if S[i] != 'R' and S[i] != 'U' and S[i] != 'D':
      Ans = False
      break
  
if Ans == False:
  print('No')
else:
  print('Yes')