In this problem you will be given an integer array A of size N, your task is find whether given array is sorted or not (in ascending order) , if print "YES" else print "NO". 

Array a[n] is sorted if  a[0] ≤ a[1] ≤ ... a[n - 1].

Input

First line of input contains contains integer T denoting number of test cases. 
For each test case T, first line of input contains number N denoting size of array A and second line contains N space seperated integers denoting elements of array A.

Output

Print "YES" or "NO" as explained above.

Constraints

1 ≤ T ≤ 10

1 ≤ N ≤ 100,000

1 ≤ A[i] ≤ 10,00,00,00,000 

SAMPLE INPUT
3
4
1 2 3 4
3
7 66 10 
2 
1 0

SAMPLE OUTPUT
YES
NO
NO
t = input()
while t>0:
	t-=1
	n = input()
	a = map(int, raw_input().split())
	if n == 1:
		print "YES"
		continue
	s = True
	for i in range(1, n):
		if a[i] < a[i-1]:
			s = False
			break
	if s == True:
		print "YES"
	else:
		print "NO"