title: Remove elements from list which are just before some specific element
body: <p>Let's say I am having a list as:</p>
  
  <pre><code>a = ['no', 'no', 'no', 'yes', 'no', 'yes', 'no']
  </code></pre>
  
  <p>Here I want to <strong>remove every <code>'no'</code> which is preceded by every <code>'yes'</code></strong>. So <strong>my resultant list should be like</strong>:</p>
  
  <pre><code>['no', 'no', 'yes', 'yes', 'no']
  </code></pre>
  
  <hr>
  
  <p>I've found that in order to remove an element from a list by its value, we may use <code>list.remove(..)</code> as:</p>
  
  <pre><code>a = ['no', 'no', 'no', 'yes', 'no', 'yes', 'no']
  a.remove('no')
  print a
  </code></pre>
  
  <p>But it gives me result with only removing first occurrence of <code>'no'</code> as:</p>
  
  <pre><code>['no', 'no', 'yes', 'no', 'yes', 'no']
  </code></pre>
  
  <p><strong>How can I achieve the desired result by removing all the occurrence of <code>'no'</code> which are preceded by all <code>'yes'</code> in my list?</strong></p>