You are given the array a consisting of n positive (greater than zero) integers.
In one move, you can choose two indices i and j (i≠j) such that the absolute difference between a[i] and a[j] is no more than one (|a[i]−a[j]|≤1) and remove the smallest of these two elements. If two elements are equal, you can remove any of them (but exactly one).
Your task is to find if it is possible to obtain the array consisting of only one element using several (possibly, zero) such moves or not.
You have to answer t independent test cases.
给定数组 a ,由 n 个正(大于零)的整数组成。
可以一次性选择两个指标 i 和 j (i≠j),使 a[i] 和 a[j] 之间的绝对差不超过1 (|a[i]−a[j]|≤1),并去掉这两个元素中最小的一个。如果两个元素相等,则可以删除其中任何一个元素(但只能删除一个)。
你的任务是确定能否通过若干次(可能是 0 次)这样的操作使数组中只剩一个整数。
你必须回答 t 个独立的测试用例。
The first line of the input contains one integer t (1≤t≤1000) — the number of test cases. Then t test cases follow.
The first line of the test case contains one integer n (1≤n≤50) — the length of a. The second line of the test case contains n integers a[1],a[2],…,a[n] (1≤a[i]≤100), where a[i] is the i-th element of a.
输入的第一行包含一个整数 t(1≤t≤1000)——测试用例的数量。然后是t个测试用例。
每组测试用例的第一行包含一个整数 n (1≤n≤50)- a的长度。测试用例的第二行包含n个整数 a[1],a[2],…,a[n](1≤a[i]≤100),其中 a[i] 是 a 的第 i 个元素。
For each test case, print the answer: "YES" if it is possible to obtain the array consisting of only one element using several (possibly, zero) moves described in the problem statement, or "NO" otherwise.
对于每组测试用例,如果经过若干次操作可以使数组中只剩下一个元素,输出 “YES”(无引号);否则输出“NO”。