i need to find a list is True or False in which numbers are in increasing order followed by decreasing order.

or numbers in decreasing order followed by increasing order.
You can assume that consecutive numbers in the input sequence are always different from each other.

i tried the below code but unable get the appropriate return value i.e(True/False)
can someone give give any suggestion on how to improve my code?

```
def hillvalley(A): 

    return (all(A[i] <= A[i + 1] for i in range(len(A) - 1)) or
        all(A[i] >= A[i + 1] for i in range(len(A) - 1))) 

hillvalley([1,2,3,5,4,3,2,1])

```