B. Nostalgia
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Omar left his home for 14 years because of the war in Syria.

He has a favorite array $$$a$$$ of size $$$n$$$.

Before he left, he used to do the following process:

  • Consider all possible triples of indices $$$(i, j, k)$$$ with $$$1 \le i \lt j \lt k \le n$$$.
  • For each triple, he takes the three values $$$a_i$$$, $$$a_j$$$, $$$a_k$$$, sorts them, and writes down the median (the middle element) on a piece of paper.
  • He does this for every triple, in some random order.

After returning home, he found that his array was lost due to the destruction. However, he managed to find the paper where he had written all the medians.

But the paper is damaged — some numbers may be incorrect. Omar is not sure if the information on the paper is valid or not.

Given the size $$$n$$$ and a multiset of $$$\binom{n}{3}$$$ numbers (the numbers written on the paper), your task is to determine whether there exists any array $$$a$$$ of size $$$n$$$ such that the multiset of medians of all triples of indices matches exactly the given multiset.

Here $$$\binom{n}{3}$$$ denotes the binomial coefficient, which is the number of triples of distinct indices from $$$n$$$ indices:

$$$$$$ \binom{n}{3} = \frac{n(n-1)(n-2)}{6} $$$$$$

For example, $$$\binom{4}{3} = 4$$$, $$$\binom{5}{3} = 10$$$, and $$$\binom{6}{3} = 20$$$.

Input

The first line contains a single integer $$$n$$$ ($$$3 \le n \le 100$$$).

The second line contains $$$\binom{n}{3}$$$ integers $$$b_1, b_2, \ldots, b_{\binom{n}{3}}$$$ ($$$1 \le b_i \le 10^9$$$) — the numbers written on the paper.

Output

print "YES" if there exists an array $$$a$$$ of length $$$n$$$ that produces exactly this multiset of medians, otherwise print "NO".

Examples
Input
4
7 3 3 7
Output
YES
Input
5
1 2 3 4 5 6 7 8 9 10
Output
NO