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