s = list(input())

for i in range(len(s)):
  if (i+1)%2 == 0:
    if s[i] != "R":
      continue
    else:
      print("No")
      exit()
      
  else:
    if s[i] != "L":
      continue
    else:
      print("No")
      exit()
      
print("Yes") s = list(input()) s list(input()) list input() input for i in range(len(s)):
  if (i+1)%2 == 0:
    if s[i] != "R":
      continue
    else:
      print("No")
      exit()
      
  else:
    if s[i] != "L":
      continue
    else:
      print("No")
      exit()
       i range(len(s)) range len(s) len s if (i+1)%2 == 0:
    if s[i] != "R":
      continue
    else:
      print("No")
      exit()
      
  else:
    if s[i] != "L":
      continue
    else:
      print("No")
      exit()
       (i+1)%2 == 0 (i+1)%2 i+1 i 1 2 0 if s[i] != "R":
      continue
    else:
      print("No")
      exit()
      
   s[i] != "R" s[i] s i "R" continue print("No") print "No" exit() exit if s[i] != "L":
      continue
    else:
      print("No")
      exit()
       s[i] != "L" s[i] s i "L" continue print("No") print "No" exit() exit print("Yes") print "Yes" s = list(input()) list(input()) s
s = list(input())

for i in range(len(s)):
  if (i+1)%2 == 0:
    if s[i] != "R":
      continue
    else:
      print("No")
      exit()
      
  else:
    if s[i] != "L":
      continue
    else:
      print("No")
      exit()
      
print("Yes")