Extreme Sort

No attempts yetTime limit1sMemory limit256 MB

Problem

John likes sorting algorithms very much. He has studied quicksort, merge sort, radix sort and many more.

A long time ago he wrote a lock-free parallel string sorting program. It was a combination of burstsort and multi-key quicksort. To implement burstsort you build a tree of buckets. For each input string you walk down the tree and insert part of the string into the right bucket. When a bucket fills up it "bursts" and becomes a new subtree with new buckets.

Figure G.1: burstsort data structure

Enough about the past. Today John is playing with sorting algorithms again, and this time it is numbers. He has an idea for a new algorithm called "extreme sort". It is extremely fast, with performance levels over nine thousand. Before he tells anyone the details, he wants to be sure that it works correctly.

Verify that the extreme property holds after the first phase of the algorithm. The extreme property is min(xi,j)0\min(x_{i,j}) \ge 0, where

xi,j={ajai(1i<jN)9001(otherwise)x_{i,j} = \begin{cases} a_j - a_i & (1 \le i < j \le N) \\ 9001 & (\text{otherwise}) \end{cases}

Input

The first line contains a single integer NN (1N10241 \le N \le 1024).

The second line contains NN integers a1 a2  aNa_1\ a_2\ \dots\ a_N (1ai10241 \le a_i \le 1024), separated by spaces.

Output

Print one line containing yes if the extreme property holds for the given input, and no otherwise. Use lowercase letters.