Problem: As you know, any problem that does not require the use of complex data structures is considered constructive. You are offered to solve one of such problems.
You are given an array of non-negative integers. You are allowed to perform the following operation exactly once: choose some non-empty subsegment of the array and a non-negative integer , and assign value to all elements of the array on the chosen subsegment.
The task is to find out whether can be increased by exactly one by performing such an operation. In other words, if before the operation held, then after the operation it must hold that .
Recall that of a set of integers is defined as the smallest non-negative integer which does not occur in the set .
Input Format: Each test contains multiple test cases. The first line contains the number of test cases () — the number of test cases. The description of the test cases follows.
The first line of each test case contains a single integer () — the number of elements of array .
The second line of each test case contains integers () — elements of array .
It is guaranteed that the sum over all test cases does not exceed .
Output Format: For each test case, print "Yes" if you can increase by exactly one by performing the operation from the statement exactly once, otherwise print "No".
You can output the answer in any case (upper or lower). For example, the strings "yEs", "yes", "Yes", and "YES" will be recognized as positive responses.
Note: In the first test case, . If you set all elements of to , then of the resulting array will be , and thus will increase by one.
In the second test case, . If we assign a value of to the elements of on a subsegment from to , we get an array for which is , and thus is increased by one compared to the original.
It can be shown that in the third and fourth test cases it is impossible to perform an operation so that the value of increases by exactly one.