title: Find AB and BA in a string without overlapping
body: <p>Find AB and BA in a string without overlapping.
  The order of AB and BA is not important.
  I'm having trouble writing this app as follows:</p>
  
  <pre><code>s = input()
  chars = set('AB' and 'BA')
  if all((c in chars) for c in s):
      print('YES')
  </code></pre>
  
  <p>For example, if the input is ABBA, the answer is YES. If there is a <code>BAAB</code> input, then I have YES. But if the input is <code>ABA</code>, the answer is NO, or if the input is <code>ABHA</code>, then the answer is NO.</p>
  
  <pre><code>else:
      print('NO')
  </code></pre>