1202: Strictly Increasing Array

Memory Limit:128 MB Time Limit:2.000 S Judge Style:Text Compare Creator:
Submit:82 Solved:28

Description

Given an array a consisting of n positive integers, please determine whether it is possible to rearrange the elements to form a strictly increasing array. In other words, determine if it is possible to rearrange the elements in such a way that a1<a2<...<an holds true.

不允许普通用户打印题目,请教师登录后使用。如有疑问请联系管理员!

Input

The first line contains an integer t<=100 test cases.

The first line of each test case contains the length of an integer n<=30000 array.

The second line of each test case contains n integers ai (1<=ai<=10 ^ 9) - elements of an array.

Output

For each test case, if the array meets the conditions, output "YES" (without quotes), otherwise output "NO" (without quotes).

Sample Input Copy

2
5
1 2 4 5 7
4
1 2 3 2

Sample Output Copy

YES
NO