title: List containing the given set of elements in the given order
body: <p>I am having difficulties in writing code with finding elements in the list.</p>
  
  <ul>
  <li><p>I need to write a program that prints "YES" if the list contains numbers 1, 2, 3 (all of them) in an arbitrary order and "NO" otherwise.</p>
  
  <pre><code>[10, 2, 4, 15, 3, 6, 1]   # YES
  [1, 17, 2, 45]            # NO (because number 3 is missing)
  </code></pre></li>
  <li><p>Also, I need to modify the program to prints "YES" if it contains all the numbers 1, 2, 3 occurring in the order they are listed (but not necessarily consecutively) and "NO" otherwise.</p>
  
  <pre><code>[45, 1, 5, 2, 77, 3]      # YES
  [45, 1, 3, 77, 2]         # NO (incorrect order)
  </code></pre>
  
  <p>Clearly, the program should also print "NO" if one of 1, 2, 3 is missing. The tricky part of this task are cases of multiple occurrences of 1, 2, 3. For
  instance the program should print "YES" if <code>[3, 2, 1, 2, 3]</code> because there
  are occurrences of 1, 2, 3 appearing in the correct order while "NO" should be
  printed for <code>[3, 3, 2, 2, 1, 2]</code> because there are no such occurrences.</p></li>
  </ul>
  
  <p>I am not a pro at programming, so I am a little bit confused, because my source code for the first task doesn't give me the right output:</p>
  
  <pre><code>n=int(input("Please enter the list length "))
  A=[]
  
  for i in range (0,n):
      print("Entering element ",i)
      CurEl=int(input("Please enter the element "))
      A.append(CurEl)
  print(A)
  for i in range (0,n):
      if (i==1) or (i==2)or (i==3):
          print("YES")
      else:
           print("NO")
  
  Output:
  Please enter the list length 5
  ('Entering element ', 0)
  Please enter the element 1
  ('Entering element ', 1)
  Please enter the element 2
  ('Entering element ', 2)
  Please enter the element 3
  ('Entering element ', 3)
  Please enter the element 4
  ('Entering element ', 4)
  Please enter the element 5
  [1, 2, 3, 4, 5]
  NO
  YES
  YES
  YES
  NO
  </code></pre>