You're given an sequence $$$a$$$ of size $$$n$$$.
Determine if there is a sequence $$$b$$$ that satisfies all the following conditions:
A subsequence of a given sequence is a sequence that can be derived from the given sequence by deleting some or no elements without changing the order of the remaining elements. For example,$$$[1,2]$$$ and $$$[1,1]$$$ are subsequences of $$$[1,2,1]$$$ but $$$[2,2]$$$ and $$$[3]$$$ are not.
Each test contains multiple test cases. The first line contains the number of test cases $$$t$$$ ($$$1 \le t \le 10^5$$$). The description of the test cases follows.
The first line of each testcase contains a single integer $$$n$$$ ($$$2 \le n \le 2\cdot 10^5$$$).
The second line of each testcase contains $$$n$$$ integers $$$a_1,a_2,\ldots, a_n$$$ ($$$1 \le a_i \le 10^9$$$).
It is guaranteed that the sum of $$$n$$$ over all test cases does not exceed $$$2 \cdot 10^5$$$.
If there is a sequence $$$b$$$ that satisfies all the following conditions output YES.Otherwise,output NO.
321 221 164 1 5 4 1 1
YES NO YES
Test Case $$$1$$$:
$$$b=[1]$$$ is one of valid sequence.For index $$$i=1$$$,note $$$c=[a_2,a_2]=[2,2]$$$,then $$$b$$$ is not a subsequence of $$$c$$$.
Test Case $$$2$$$:
For index $$$i=1,2$$$,$$$c=[1,1]$$$ always holds.No matter which subsequence $$$b$$$ of $$$a$$$ you choose, $$$b$$$ must be a subsequence of $$$c$$$.