for i,s in enumerate(input(),start=1):
  if i%2==0:
    if s=='R':
      print('No')
      exit(0)
  else:
    if s=='L':
      print('No')
      exit(0)
print('Yes') for i,s in enumerate(input(),start=1):
  if i%2==0:
    if s=='R':
      print('No')
      exit(0)
  else:
    if s=='L':
      print('No')
      exit(0) i s enumerate(input(),start=1) enumerate input() input start=1 start 1 if i%2==0:
    if s=='R':
      print('No')
      exit(0)
  else:
    if s=='L':
      print('No')
      exit(0) i%2==0 i%2 i 2 0 if s=='R':
      print('No')
      exit(0)
   s=='R' s 'R' print('No') print 'No' exit(0) exit 0 if s=='L':
      print('No')
      exit(0) s=='L' s 'L' print('No') print 'No' exit(0) exit 0 print('Yes') print 'Yes'
for i,s in enumerate(input(),start=1):
  if i%2==0:
    if s=='R':
      print('No')
      exit(0)
  else:
    if s=='L':
      print('No')
      exit(0)
print('Yes')