AMC 12B 2012 Problem 18

Let \left(a_{1}, a_{2}, \ldots, a_{10}\right) be a list of the first 10 positive integers such that for each 2 \leq i \leq 10 either a_{i}+1 or a_{i}-1 or both appear somewhere before a_{i} in the list. How many such lists are there?

Answer Choices
A. 120
B. 512
C. 1024
D. 181,440
E. 362,880