s = str(input())
bool =False
for i in range (len(s)):
  if i % 2 == 0 and s[i] == 'L':
    bool = True
  elif i % 2 != 0 and s[i] == 'R':
    bool = True
if bool == True:
  print("No")
else:
  print("Yes") s = str(input()) s str(input()) str input() input bool =False bool False for i in range (len(s)):
  if i % 2 == 0 and s[i] == 'L':
    bool = True
  elif i % 2 != 0 and s[i] == 'R':
    bool = True i range (len(s)) range len(s) len s if i % 2 == 0 and s[i] == 'L':
    bool = True
  elif i % 2 != 0 and s[i] == 'R':
    bool = True i % 2 == 0 and s[i] == 'L' i % 2 == 0 i % 2 i 2 0 s[i] == 'L' s[i] s i 'L' bool = True bool True elif i % 2 != 0 and s[i] == 'R':
    bool = True i % 2 != 0 and s[i] == 'R' i % 2 != 0 i % 2 i 2 0 s[i] == 'R' s[i] s i 'R' bool = True bool True if bool == True:
  print("No")
else:
  print("Yes") bool == True bool True print("No") print "No" print("Yes") print "Yes" s = str(input()) str(input()) s bool =False False bool bool = True True bool bool = True True bool
s = str(input())
bool =False
for i in range (len(s)):
  if i % 2 == 0 and s[i] == 'L':
    bool = True
  elif i % 2 != 0 and s[i] == 'R':
    bool = True
if bool == True:
  print("No")
else:
  print("Yes")