Statement : B. Another Sorting Problem
You are given an array $a_1, a_2, \ldots, a_n$. You can perform the following operation on this array at most once:
- Choose a positive integer $k$, as well as a subsequence $b_1, b_2, \ldots, b_m$ of the array $a$$^{\text{∗}}$ and add $k$ to each element of this subsequence, that is, for each $i$ perform $a_{b_i} := a_{b_i} + k$.
You need to determine whether it is possible to sort the array in nondecreasing order by performing this operation at most once.
$^{\text{∗}}$A sequence $b$ is a subsequence of a sequence $a$ if $b$ can be obtained from $a$ by the deletion of several (possibly, zero or all) element from arbitrary positions.
Each test contains multiple test cases. The first line contains the number of test cases $t$ ($1 \le t \le 10^4$). The description of the test cases follows.
In the first line of each test case, one integer $n$ is given ($1 \leq n \leq 2 \cdot 10^5$) — the length of the array $a$.
In the second line of each test case, $n$ integers $a_1, a_2, \ldots, a_n$ are given ($1 \leq a_i \leq 10^9$).
It is guaranteed that the sum of $n$ over all test cases does not exceed $2 \cdot 10^5$.
For each test case, print “Yes” if it is possible to sort the array by performing the operation at most once. Otherwise, print “No”. You may print the answer in any case. For example, “YeS”, “YES”, “NO”, “nO” will also be accepted.
Input
8
4
1 2 3 4
5
10 5 9 4 4
7
8 3 9 4 10 5 11
6
5 3 10 5 9 7
3
2 1 1
5
2 1 1 2 1
3
3 1 2
5
2 1 2 3 1
Output
YES
NO
YES
NO
YES
YES
YES
NO
Note
In the first test case, the array is already sorted, so the operation does not need to be performed at all.
In the second test case, it can be shown that it is impossible to sort the array using such an operation.
In the third test case, choose $k = 6$ and choose the subsequence $[2, 4, 6]$ as $b$. Then after this operation, the array $a$ becomes $[8, \textbf{9}, 9, \textbf{10}, 10, \textbf{11}, 11]$ (the elements of the chosen subsequence are shown in bold).