YouKn0wWho has an integer sequence $a_1, a_2, \ldots a_n$. Now he will split the sequence $a$ into one or more consecutive subarrays so that each element of $a$ belongs to exactly one subarray. Let $k$ be the number of resulting subarrays, and $h_1, h_2, \ldots, h_k$ be the lengths of the longest increasing subsequences of corresponding subarrays.

For example, if we split $[2, 5, 3, 1, 4, 3, 2, 2, 5, 1]$ into $[2, 5, 3, 1, 4]$, $[3, 2, 2, 5]$, $[1]$, then $h = [3, 2, 1]$.

YouKn0wWho wonders if it is possible to split the sequence $a$ in such a way that the bitwise XOR of $h_1, h_2, \ldots, h_k$ is equal to $0$. You have to tell whether it is possible.

The longest increasing subsequence (LIS) of a sequence $b_1, b_2, \ldots, b_m$ is the longest sequence of valid indices $i_1, i_2, \ldots, i_k$ such that $i_1 \lt i_2 \lt \ldots \lt i_k$ and $b_{i_1} \lt b_{i_2} \lt \ldots \lt b_{i_k}$. For example, the LIS of $[2, 5, 3, 3, 5]$ is $[2, 3, 5]$, which has length $3$.

An array $c$ is a subarray of an array $b$ if $c$ can be obtained from $b$ by deletion of several (possibly, zero or all) elements from the beginning and several (possibly, zero or all) elements from the end.


-----Input-----

The first line contains a single integer $t$ ($1 \le t \le 10000$)  — the number of test cases.

The first line of each test case contains a single integer $n$ ($2 \le n \le 10^5$).

The second line of each test case contains $n$ integers $a_1, a_2, \ldots, a_n$ ($1 \le a_i \le 10^9$).

It is guaranteed that the sum of $n$ over all test cases doesn't exceed $3 \cdot 10^5$.


-----Output-----

For each test case, print "YES" (without quotes) if it is possible to split into subarrays in the desired way, print "NO" (without quotes) otherwise. You can print each letter in any register (upper or lower).


-----Examples-----

Input
4
7
1 3 4 2 2 1 5
3
1 3 4
5
1 3 2 4 2
4
4 3 2 1
Output
YES
NO
YES
YES


-----Note-----

In the first test case, YouKn0wWho can split the sequence in the following way: $[1, 3, 4]$, $[2, 2]$, $[1, 5]$. This way, the LIS lengths are $h = [3, 1, 2]$, and the bitwise XOR of the LIS lengths is $3 \oplus 1 \oplus 2 = 0$.

In the second test case, it can be shown that it is impossible to split the sequence into subarrays that will satisfy the condition.

Difficulty: EASY

Starter code:

Solutions:
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if len(a) % 2 == 0:
		print('YES')
	else:
		flag = False
		for i in range(1, len(a)):
			if a[i - 1] >= a[i]:
				print('YES')
				flag = True
				break
		if not flag:
			print('NO')


from collections import deque, defaultdict, Counter, OrderedDict
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from heapq import heappush, heappop, heapify, nlargest, nsmallest
import os
import sys
from itertools import *
from io import BytesIO, IOBase
import math
import bisect
from math import inf
import random

def inp():
	return sys.stdin.readline().rstrip('\r\n')

def out(var):
	sys.stdout.write(str(var))

def lis():
	return list(map(int, inp().split()))

def stringlis():
	return list(map(str, inp().split()))

def sep():
	return map(int, inp().split())

def strsep():
	return map(str, inp().split())

def fsep():
	return map(float, inp().split())

def inpu():
	return int(inp())
M = 1000000007

def main():
	t = 1
	t = int(input())
	for _ in range(1, t + 1):
		n = inpu()
		arr = lis()
		if n % 2 == 0:
			print('YES')
			continue
		if arr != sorted(arr):
			print('YES')
			continue
		if len(set(arr)) == len(arr):
			print('NO')
			continue
		print('YES')
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


t = int(input())
for _ in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		flag = 0
		for i in range(1, n):
			if l[i] <= l[i - 1]:
				flag = 1
				break
		if flag == 0:
			print('NO')
		else:
			print('YES')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	prev = -1
	flag = False
	for i in range(n):
		if arr[i] <= prev:
			flag = True
			break
		prev = arr[i]
	if flag:
		print('YES')
	else:
		print('NO')


from math import ceil, log2, floor, sqrt, gcd
from collections import defaultdict, deque
import sys
import os.path
sys.setrecursionlimit(200000)
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r+')
	sys.stdout = open('output.txt', 'w')

def MI():
	return map(int, input().split())

def bfs(s, adj):
	V = 10 ** 5 + 2
	visited = [False] * V
	level = [0] * V
	for i in range(V):
		visited[i] = False
		level[i] = 0
	queue = deque()
	visited[s] = True
	queue.append(s)
	level[s] = 0
	while len(queue) > 0:
		s = queue.popleft()
		for i in adj[s]:
			if not visited[i]:
				level[i] = level[s] + 1
				visited[i] = True
				queue.append(i)
	return level

def dfs(node, tree, d, v):
	v[node] = 1
	for j in d[node]:
		if v[j] == 0:
			tree[node].append(j)
			dfs(j, tree, d, v)
mod = 10 ** 9 + 7

def solve(testcase):
	n = int(input())
	a = list(MI())
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				print('YES')
				return
		print('NO')
t = int(input())
for _ in range(t):
	solve(_ + 1)


def isSorted(a):
	for i in range(len(a)):
		if i != 0:
			if a[i] <= a[i - 1]:
				return False
	return True
t = int(input())
while t:
	n = int(input())
	a = list(map(int, input().split()))
	t -= 1
	hasEvenLength = not n % 2
	hasAtleastOneDecreasingPair = not isSorted(a)
	if hasEvenLength or hasAtleastOneDecreasingPair:
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(i) for i in input().split(' ')]
	if len(a) % 2 == 0:
		print('YES')
	else:
		done = False
		for (i, val) in enumerate(a[:-1]):
			if val >= a[i + 1]:
				print('YES')
				done = True
				break
		if not done:
			if len(a) < 7:
				print('NO')
			elif (len(a) - 7 + 1) % 2 == 0:
				print('YES')
			else:
				print('NO')


def solve():
	n = int(input())
	a = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
		return 0
	elif n == 1:
		print('NO')
		return 0
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				print('YES')
				return 0
		print('NO')
t = int(input())
while t > 0:
	t = t - 1
	solve()


import sys
import os.path
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
	sys.stderr = open('error.txt', 'w')
depth = 1000000
mod = 1000000007
lim = mod * mod
sys.setrecursionlimit(depth)
linp = lambda : list(minp())
minp = lambda : map(int, input().split())
from math import inf, ceil, sqrt, log2, gcd
from collections import defaultdict, deque
dxy = [(1, 0), (-1, 0), (0, 1), (0, -1)]
for _ in range(int(input())):
	(n, a) = (int(input()), linp())
	if n % 2 == 0:
		print('YES')
	elif a == sorted(list(set(a))):
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		z = False
		p = -1
		for i in a:
			if i <= p:
				z = True
			p = i
		if z:
			print('YES')
		else:
			print('NO')


from __future__ import print_function
from math import *
from collections import deque
import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
mod = 10 ** 9 + 7

def inp():
	return int(input())

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	n = inp()
	l = inlt()
	if n % 2 == 0:
		print('YES')
		continue
	f = 0
	for i in range(n - 1):
		if l[i] >= l[i + 1]:
			f = 1
			break
	if f:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	lst = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		flag = 0
		for i in range(n - 1):
			if lst[i + 1] <= lst[i]:
				flag = 1
		if flag == 1:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	n = int(input())
	a = [*map(int, input().split())]
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				print('YES')
				break
		else:
			print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	res = True
	for i in range(n - 1):
		res = res and a[i + 1] > a[i]
	if res and n % 2 == 1:
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	ans = 'YES'
	n = int(input())
	arr = list(map(int, input().split()))
	if n & 1:
		for (x, y) in zip(arr[:-1], arr[1:]):
			if y <= x:
				break
		else:
			ans = 'NO'
	print(ans)


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	c = 0
	if n & 1 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				c = 1
		if c == 0:
			print('NO')
		else:
			print('YES')


import os, sys
from io import BytesIO, IOBase
from types import GeneratorType
from bisect import *
from collections import defaultdict, deque, Counter
import math, string
from heapq import *
from operator import add
from itertools import accumulate
BUFSIZE = 8192
sys.setrecursionlimit(10 ** 5)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
inf = float('inf')
en = lambda x: list(enumerate(x))
ceil_ = lambda a, b: (a + b - 1) // b
ii = lambda : int(input())
r = lambda : map(int, input().split())
rr = lambda : list(r())

def solve():
	n = ii()
	arr = rr()
	if n % 2 == 0:
		print('YES')
		return
	else:
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				print('YES')
				return
		print('NO')
for _ in ' ' * ii():
	solve()


import copy
import math
fin = None
fout = None
uabet = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']
abet = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
INF = 10 ** 18

def start(filename):
	filename = filename.replace('.py', '')
	global fin
	global fout
	infile = filename + '.in'
	outfile = filename + '.out'
	fin = open(infile)
	fout = open(outfile, 'w')

def permutation(lst):
	if len(lst) == 0:
		return []
	if len(lst) == 1:
		return [lst]
	l = []
	for i in range(len(lst)):
		m = lst[i]
		remLst = lst[:i] + lst[i + 1:]
		for p in permutation(remLst):
			l.append([m] + p)
	return l

def subsets(x):
	retset = []
	if len(x) == 0:
		retset = [[]]
	else:
		first = x[-1]
		cop = x.copy()
		cop.remove(first)
		y = subsets(cop)
		retset.extend(copy.deepcopy(y))
		m = copy.deepcopy(y)
		for i in range(len(y)):
			k = m[0]
			m.remove(k)
			k.append(first)
			m.append(k)
		retset.extend(m.copy())
	return retset

class Point:

	def __init__(self, x, y):
		self.x = x
		self.y = y

	def __str__(self):
		return str(self.x) + str(self.y)

	def __hash__(self):
		return hash(str(self))

	def __eq__(self, other):
		return self.x == other.x and self.y == other.y

class frac:

	def __init__(self, n, d):
		self.n = n
		self.d = d

	def __str__(self):
		return str(self.n) + '/' + str(self.d)

	def __hash__(self):
		return hash(str(self))

	def simp(self):
		div = math.gcd(self.n, self.d)
		self.n = self.n / div
		self.d = self.d / div

	def __eq__(self, other):
		return self.n / self.d == other.n / other.d

	def __lt__(self, other):
		return self.n / self.d < other.n / other.d

class Interval:

	def __init__(self, start, end):
		self.start = start
		self.end = end

	def __str__(self):
		return str(self.start) + str(self.end)

	def __hash__(self):
		return hash(str(self))

	def __eq__(self, other):
		return self.start == other.start and self.end == other.end

	def __lt__(self, other):
		return self.start < other.start

def overlap(verl1, verl2):
	if verl1.end >= verl2.start:
		return True
	else:
		return False

def merge(verl1, verl2):
	retverl = Interval(min(verl1.start, verl2.start), max(verl1.end, verl2.end))
	return retverl

def changeBase(num, base):
	if base == 2:
		return '{0:b}'.format(num)
	power = math.floor(math.log(num, base))
	remainder = num
	end = []
	iter = list(range(power + 1))
	iter.reverse()
	for i in iter:
		if remainder >= base ** i:
			(q, r) = divmod(remainder, base ** i)
			end.append(q)
			remainder = r
		else:
			end.append(0)
	retlist = []
	for i in end:
		if i > 9:
			retlist.append(uabet[i - 10])
		else:
			retlist.append(i)
	retlist = map(str, retlist)
	return ''.join(retlist)

def prime(num):
	if num == 2:
		return True
	if num % 2 == 0:
		return False
	for i in range(2, math.ceil(num ** 0.5) + 1):
		if num % i == 0:
			return False
	return True

def solve(n, a):
	if n % 2 == 0:
		return 'yes'
	f = 0
	for i in range(n - 1):
		if a[i] >= a[i + 1]:
			f = 1
			break
	if f == 1:
		return 'Yes'
	return 'no'

def main():
	t = int(input())
	for i in range(t):
		n = int(input())
		a = list(map(int, input().split(' ')))
		print(solve(n, a))
main()


n = 0
t = 0
N = []
t = int(input())
for w in range(t):
	n = int(input())
	N = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	old = N[0]
	new = 0
	isGood = False
	for i in range(1, n):
		new = N[i]
		if old >= new:
			isGood = True
			break
		old = new
	if isGood:
		print('YES')
	else:
		print('NO')


from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if l[i] >= l[i + 1]:
				print('YES')
				break
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
	else:
		ok = False
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				ok = True
				break
		if ok:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n & 1:
		flag = False
		for i in range(n - 1):
			if a[i + 1] <= a[i]:
				flag = True
				break
		if flag:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


t = int(input())
for tc in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	st = True
	for i in range(1, n):
		if arr[i] <= arr[i - 1]:
			st = False
			break
	if st == False:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	b = 0
	if n % 2 == 0:
		print('YES')
	elif a == sorted(a):
		for j in range(n - 1):
			if a[j] == a[j + 1]:
				b = 1
				break
		if b == 1:
			print('YES')
		elif b == 0:
			print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	print('YES' if any((arr[i] >= arr[i + 1] for i in range(n - 1))) | (not n & 1) else 'NO')


for _ in range(int(input())):
	n = int(input())
	A = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		ok = False
		for i in range(n - 1):
			if A[i] >= A[i + 1]:
				ok = True
				break
		if ok:
			print('YES')
		else:
			print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	l = list(map(int, input().split()))
	c = 0
	for i in range(1, n):
		if l[i] <= l[i - 1]:
			c = 1
			break
	if c == 1 or n % 2 == 0:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	for (i, x) in enumerate(arr):
		if i == 0:
			continue
		if x <= arr[i - 1]:
			print('YES')
			break
	else:
		print('NO')


import io, os
input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def main(t):
	n = int(input())
	arr = list(map(int, input().split()))
	flag = False
	for i in range(n - 1):
		if arr[i] >= arr[i + 1]:
			flag = True
	if not flag and n % 2 == 1:
		print('NO')
	else:
		print('YES')
T = int(input())
t = 1
while t <= T:
	main(t)
	t += 1


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	ans = 'NO'
	for i in range(n - 1):
		if a[i] >= a[i + 1]:
			ans = 'YES'
			break
	if n % 2 == 0:
		ans = 'YES'
	print(ans)


from sys import stdin, stdout
for _ in range(int(stdin.readline())):
	n = int(stdin.readline())
	a = list(map(int, stdin.readline().split()))
	if sorted(a) == a and n % 2 == 1 and (len(list(set(a))) == n):
		print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	(n, b, p) = (int(input()), 1, 0)
	for i in map(int, input().split()):
		if not i > p:
			b = 0
		p = i
	print('YES' if n % 2 == 0 or not b else 'NO')


from math import *
from bisect import bisect_left as bl
from bisect import bisect_right as br
from collections import Counter as ctr
from collections import deque as dq
from array import array
from re import search
li = lambda : list(map(int, input().split()))
arr = lambda a: array('i', a)
bi = lambda n: bin(n).replace('0b', '')
yn = lambda f: print('NYOE S'[f::2])
sbstr = lambda a, s: search('.*'.join(a), s)

def smnd(n):
	for i in range(2, n + 1):
		if n % i != 0:
			return i
		return n + 1

def solve():
	for _ in range(int(input())):
		n = int(input())
		a = li()
		if n % 2 == 0:
			print('YES')
		else:
			for i in range(n - 1):
				if a[i] >= a[i + 1]:
					print('YES')
					break
			else:
				print('NO')
solve()


import os
import sys
from io import BytesIO, IOBase

def main():
	pass
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()
T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split()))
	ans = 0
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if A[i] >= A[i + 1]:
				ans = 1
				break
		if ans == 1:
			print('YES')
		else:
			print('NO')


T = int(input())
for ttt in range(T):
	tt = input()
	tarr = input().split(' ')
	for (i, t) in enumerate(tarr):
		tarr[i] = int(t)
	if len(tarr) % 2 == 0:
		print('YES')
		continue
	ok = False
	for i in range(len(tarr) - 1):
		if tarr[i] >= tarr[i + 1]:
			ok = True
			break
	if ok:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	s = list(map(int, input().split()))
	if n % 2:
		for i in range(1, n):
			if s[i - 1] >= s[i]:
				print('YES')
				break
		else:
			print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split(' ')))
	d = 0
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(1, n):
			if l[i] <= l[i - 1]:
				d = 1
		if d == 1:
			print('YES')
		else:
			print('NO')


for t in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	else:
		arr2 = arr[:]
		arr2.sort()
		if arr == arr2:
			if len(set(arr2)) != n:
				print('YES')
				continue
			else:
				print('NO')
				continue
		else:
			print('YES')
			continue


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		ans = False
		for i in range(1, n):
			if l[i] <= l[i - 1]:
				ans = True
				break
		print(['NO', 'YES'][ans == True])


for i in range(int(input())):
	n = int(input())
	li = list(map(int, input().split()))
	f = 1
	if n % 2 != 0:
		for i in range(n - 1):
			if li[i] >= li[i + 1]:
				f = 0
				break
	else:
		f = 0
	if f == 1:
		print('NO')
	else:
		print('YES')


import sys
INF = 10 ** 20
MOD = 10 ** 9 + 7
I = lambda : list(map(int, input().split()))
from math import gcd
from math import ceil, log2, factorial
from collections import defaultdict as dd, Counter
from bisect import bisect_left as bl, bisect_right as br
TESTS = 1

def solve():
	(n,) = I()
	a = I()
	if n % 2 == 0:
		print('YES')
		return
	for i in range(1, n):
		if a[i - 1] >= a[i]:
			print('YES')
			return
	print('NO')

def main():
	if not TESTS:
		solve()
		return
	(t,) = I()
	while t:
		solve()
		t -= 1
main()


from sys import stdin
from collections import deque
lst = list(map(int, stdin.read().split()))
_s = 0

def inp(n=1):
	global _s
	ret = lst[_s:_s + n]
	_s += n
	return ret

def inp1():
	return inp()[0]
t = inp1()
for _ in range(t):
	n = inp1()
	a = inp(n)
	if n % 2 == 1 and sorted(a) == a and (len(set(a)) == n):
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	nums = list(map(int, input().split()))
	if n & 1:
		possible = False
		for i in range(n - 1):
			if nums[i] >= nums[i + 1]:
				possible = True
				break
		if possible:
			print('YES')
		else:
			print('NO')
		pass
	else:
		print('YES')


n = int(input())
for i in range(n):
	lench = int(input())
	chisla = list(map(int, input().split()))
	last_el = chisla[0]
	if lench % 2 == 0:
		print('YES')
		continue
	else:
		t_flag = True
		for k in range(1, lench):
			if chisla[k] <= last_el:
				t_flag = False
				break
			last_el = chisla[k]
		if t_flag:
			print('NO')
		else:
			print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		ver = False
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				ver = True
				break
		if ver:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
		continue
	pas = False
	for i in range(n - 1):
		if a[i] >= a[i + 1]:
			pas = True
	print('YES' if pas else 'NO')


def xor_specialist(a, n):
	last_a = float('-inf')
	for i in range(n):
		if last_a >= a[i]:
			return 'YES'
		last_a = a[i]
	if n % 2 == 1:
		return 'NO'
	return 'YES'
t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split(' ')))
	print(xor_specialist(a, n))


I = input
for _ in range(int(I())):
	n = int(I())
	lst = list(map(int, I().split()))
	if all((lst[i + 1] > lst[i] for i in range(n - 1))) and n & 1 == 1:
		print('NO')
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		x = any((a[i] <= a[i - 1] for i in range(1, n)))
		if x:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	N = int(input())
	A = list(map(int, input().split()))
	if N % 2:
		flag = False
		for i in range(N - 1):
			flag |= A[i] >= A[i + 1]
		if flag:
			print('YES')
		else:
			print('No')
	else:
		print('YES')


for s in [*open(0)][2::2]:
	a = (*map(int, s.split()),)
	print('YNEOS'[len(a) & all((x < y for (x, y) in zip(a, a[1:])))::2])


t = int(input())
for t_i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	if n == 1:
		print('NO')
		continue
	if n % 2 == 0:
		print('YES')
		continue
	flag = False
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			flag = True
			break
	if flag == True:
		print('YES')
	else:
		print('NO')


from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
from typing import Counter
import bisect
if sys.version_info[0] < 3:
	from __builtin__ import xrange as range
	from future_builtins import ascii, filter, hex, map, oct, zip

def gcd(a, b):
	if b == 0:
		return a
	return gcd(b, a % b)

def main():
	t = int(input())
	while t:
		n = int(input())
		a = list(map(int, input().split()))
		if n & 1 == 0:
			print('YES')
		else:
			ok = 0
			for i in range(1, n):
				if a[i] <= a[i - 1]:
					ok = 1
			if ok:
				print('YES')
			else:
				print('NO')
		t -= 1
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')
main()


n = int(input())
for i in range(n):
	f = 0
	k = int(input())
	a = list(map(int, input().split()))
	for i in range(1, k):
		if a[i] <= a[i - 1]:
			f = 1
	if f == 1 or k % 2 == 0:
		print('yes')
	else:
		print('no')


for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n & 1:
		flag = 0
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				flag = 1
		if flag:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


import sys
from functools import lru_cache
from collections import defaultdict, deque
from types import GeneratorType
input = sys.stdin.readline

def sign(num):
	return 1 if num > 0 else -1

def solve(nums):
	if len(nums) % 2 == 0:
		return 'YES'
	ascending_seq = True
	for i in range(1, len(nums)):
		if nums[i] <= nums[i - 1]:
			return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	input()
	nums = [int(num) for num in input().split()]
	print(solve(nums))


T = int(input())
for t in range(T):
	n = int(input())
	numbers = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
	else:
		isdes = False
		for i in range(n - 1):
			if numbers[i] >= numbers[i + 1]:
				isdes = True
				break
		if isdes:
			print('YES')
		else:
			print('NO')


import sys
IS_INTERACTIVE = False
input = input
if not IS_INTERACTIVE:
	(*data,) = sys.stdin.read().split('\n')[::-1]

	def input():
		return data.pop()

def fprint(*args, **kwargs):
	print(*args, **kwargs, flush=True)

def eprint(*args, **kwargs):
	print(*args, **kwargs, file=sys.stderr)
for _ in range(int(input())):
	n = int(input())
	(*arr,) = map(int, input().split())
	if n % 2 == 0:
		print('YES')
	else:
		is_ok = False
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				is_ok = True
		print('YES' if is_ok else 'NO')


import math
debug = True

def pprint(*args, delimiter='#', amount=10):
	if debug:
		print('{0} DEBUG {0}'.format(delimiter * amount))
		print(*args)
		print('{0} ----- {0}'.format('-' * amount))

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		return 'YES'
	for i in range(n - 1):
		if a[i] >= a[i + 1]:
			return 'YES'
	return 'NO'
t = int(input())
while t > 0:
	t -= 1
	print(solve())


for i in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n & 1 == 0:
		print('YES')
	else:
		found = False
		for i in range(1, n):
			if arr[i - 1] >= arr[i]:
				found = True
				break
		print('YES' if found else 'NO')


def solve():
	n = int(input())
	a = list(map(int, input().strip().split()))[:n]
	if n % 2 == 0:
		return 'YES'
	else:
		for i in range(n - 1):
			if a[i + 1] <= a[i]:
				return 'YES'
		return 'NO'

def main():
	t = int(input())
	for i in range(t):
		print(solve())
main()


def isupr(arr):
	for i in range(len(arr) - 1):
		if arr[i] >= arr[i + 1]:
			return False
	return True
for q in range(int(input())):
	n = int(input())
	arr = [*map(int, input().split())]
	if n % 2 == 0:
		print('YES')
	elif isupr(arr):
		print('NO')
	else:
		print('YES')


n = int(input())
for i in range(n):
	a = int(input())
	ar = list(map(int, input().split()))
	if a % 2 == 0:
		print('YES')
		continue
	b = True
	for i in range(a - 1):
		if ar[i] >= ar[i + 1]:
			b = False
			break
	print('YES' if not b else 'NO')


import os
import sys
from io import BytesIO, IOBase
from collections import Counter
import math as mt
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def gcd(a, b):
	if a == 0:
		return b
	return gcd(b % a, a)

def lcm(a, b):
	return a * b / gcd(a, b)
mod = int(1000000000.0) + 7

def power(k, n):
	if n == 0:
		return 1
	if n % 2:
		return power(k, n - 1) * k % mod
	t = power(k, n // 2)
	return t * t % mod

def totalPrimeFactors(n):
	count = 0
	if n % 2 == 0:
		count += 1
		while n % 2 == 0:
			n //= 2
	i = 3
	while i * i <= n:
		if n % i == 0:
			count += 1
			while n % i == 0:
				n //= i
		i += 2
	if n > 2:
		count += 1
	return count

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		f = 0
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				f = 1
		if f == 1:
			print('YES')
		elif n % 2 == 0:
			print('YES')
		else:
			print('NO')
	return
main()


from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def I():
	return int(input())

def lint():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
import itertools
from sys import maxsize, stdout, stdin, stderr
mod = int(1000000000.0 + 7)
import sys

def S():
	return list(map(str, input().strip()))

def grid(r, c):
	return [lint() for i in range(r)]
from collections import defaultdict, Counter, deque
import math
import heapq
from heapq import heappop, heappush
import bisect
from math import factorial, inf
from itertools import groupby
from itertools import permutations as comb
mod = 1000000007
MOD = 998244353

def gcd(a, b):
	while b:
		a %= b
		tmp = a
		a = b
		b = tmp
	return a

def lcm(a, b):
	return a // gcd(a, b) * b

def check_prime(n):
	for i in range(2, int(n ** (1 / 2)) + 1):
		if not n % i:
			return False
	return True

def primefactors(n):
	num = 0
	while n % 2 == 0:
		num += 1
		n = n / 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			num += 1
			n = n // i
	if n > 2:
		num += 1
	return num

def ask(a, b, c):
	print(c, a, b, flush=True)
	n = I()
	return n

def linear_sieve(n):
	is_composite = [False] * n
	prime = []
	for i in range(2, n):
		if not is_composite[i]:
			prime.append(i)
		for j in prime:
			is_composite[i * j] = True
			if i % prime == 0:
				break
	return prime

def dfs(i, p, d):
	(a, tmp) = (0, 0)
	for j in d[i]:
		if j != p:
			a += 1
			tmp += dfs(j, i)
	if a == 0:
		return 0
	return tmp / a + 1

def primeFactors(n):
	l = []
	while n % 2 == 0:
		l.append(2)
		n = n // 2
	for i in range(3, int(math.sqrt(n)) + 1, 2):
		while n % i == 0:
			l.append(i)
			n = n // i
	if n > 2:
		l.append(n)
	return l

def binpow(a, b, c):
	res = 1
	a = a % c
	while b > 0:
		if b & 1:
			res = res * a % c
		b = b >> 1
		a = a * a % c
	return res
d = []
primes = []
prim = [0] * (10 ** 5 + 1)

def sieve(n):
	for i in range(n):
		d.append(i)
	for i in range(2, n):
		if d[i] == i:
			prim[i] = 1
			primes.append(i)
		j = 0
		while j < len(primes) and primes[j] <= d[i] and (primes[j] * i < n):
			d[i * primes[j]] = primes[j]
			j += 1

def primeFactors(n):
	factors = []
	while n != 1:
		factors.append(d[n])
		n //= d[n]
	return factors
t = 1
t = I()
for _ in range(t):
	n = I()
	s = lint()
	if n % 2 == 0:
		print('YES')
	else:
		flag = False
		for i in range(n - 1):
			if s[i] >= s[i + 1]:
				flag = True
				break
		if flag:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	n = int(input())
	arr = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
	else:
		printed = False
		for j in range(n - 1):
			if arr[j + 1] <= arr[j]:
				print('YES')
				printed = True
				break
		if not printed:
			print('NO')


import sys

def read_line():
	return sys.stdin.readline()
cases = int(read_line())
for _ in range(cases):
	N = int(read_line())
	arr = read_line().split()
	if N % 2 == 0:
		print('YES')
		continue
	num_arr = list(map(int, arr))
	found = 0
	for i in range(len(arr)):
		if i > 0 and num_arr[i - 1] >= num_arr[i]:
			found = 1
			break
	if found == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	ans = 0
	if len(a) % 2 == 0:
		print('YES')
	else:
		flag = 0
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				flag = 1
				break
			else:
				flag = 0
		if flag == 1:
			print('YES')
		else:
			print('NO')


T = int(input())
for t in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	if (sorted(arr) == arr) & (n == len(set(arr))):
		print('NO')
		continue
	else:
		print('YES')


t = int(input())
for _ in range(t):
	n = int(input())
	s = str(input())
	array = [int(i) for i in s.split()]
	if n % 2 == 0:
		print('YES')
		continue
	is_sorted = True
	for i in range(1, n):
		if array[i] > array[i - 1]:
			continue
		else:
			is_sorted = False
			break
	if not is_sorted:
		print('YES')
		continue
	print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	flag = 0
	if len(a) % 2 == 0:
		flag = 1
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				flag = 1
	if flag == 0:
		print('NO')
	else:
		print('YES')


def get_ans(a, n):
	if n % 2 == 0:
		return True
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			return True
	return False
anss = []
t = int(input())
for _ in range(t):
	_n = int(input())
	_a = list(map(int, input().split()))
	anss.append(get_ans(_a, _n))
for ans in anss:
	if ans:
		print('YES')
	else:
		print('NO')


def mono(arr):
	for i in range(1, len(arr)):
		if arr[i] <= arr[i - 1]:
			return False
	return True
t = int(input())
for test in range(t):
	n = int(input())
	p = list(map(int, input().split()))
	ans = 'YES'
	if n % 2 != 0:
		if mono(p):
			ans = 'NO'
			for i in range(10):
				if 2 ** (i - 1) * (2 ** i - 1) == n:
					ans = 'YES'
	print(ans)


def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	if n & 1:
		return any((arr[i] >= arr[i + 1] for i in range(n - 1)))
	return True
for t in range(int(input())):
	print('YES' if solve() else 'NO')


t = int(input())
while t != 0:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		flag = 0
		for i in range(1, n):
			if arr[i] <= arr[i - 1]:
				flag = 1
				break
		if flag == 0:
			print('NO')
		else:
			print('YES')


def xorSpecialist(n, array):
	if n % 2 == 0:
		return 'YES'
	a = sorted(array)
	if a == array and len(set(a)) == n:
		return 'NO'
	else:
		return 'YES'
t = int(input())
final = []
for _ in range(t):
	n = int(input())
	array = list(map(int, input().split()))
	final.append(xorSpecialist(n, array))
for _ in range(t):
	print(final[_])


t = int(input())
while t:
	t -= 1
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 != 0:
		f = 0
		for i in range(len(arr) - 1):
			if arr[i + 1] <= arr[i]:
				f = 1
		if f == 1:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	bl = True
	gl = False
	if n % 2 == 1:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				gl = True
				break
		if not gl:
			bl = False
	print('YES' if bl else 'NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	f = 0
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			f = 1
			break
	if n % 2 == 0 or f == 1:
		print('YES')
	else:
		print('NO')


inf = float('inf')
import sys
import pprint
import logging
from logging import getLogger
import array
import collections

def input():
	return sys.stdin.readline().rstrip('\r\n')

def maps():
	return [int(i) for i in input().split()]
logging.basicConfig(format='%(message)s', level=logging.WARNING)
logger = getLogger(__name__)
logger.setLevel(logging.INFO)

def debug(msg, *args):
	logger.info(f'{msg}={pprint.pformat(args)}')
from bisect import bisect_left
for _ in range(*maps()):
	(n,) = maps()
	a = list(maps())
	if n % 2 == 0:
		print('YES')
		continue
	ok = False
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			ok = True
	print(['NO', 'YES'][ok])


def getint():
	return [int(i) for i in input().split()]

def get():
	return int(input())

def getstr():
	return [i for i in input().split()]

def S():
	for test in range(int(input())):
		solve()
import math
import itertools as it
import bisect
import time
import collections as ct

def solve():
	n = get()
	a = getint()
	a = [0] + a
	flag = False
	if n % 2 == 0:
		flag = True
	for i in range(2, n + 1):
		if a[i] <= a[i - 1]:
			flag = True
	if flag:
		print('YES')
	else:
		print('NO')
S()


import sys
readline = sys.stdin.readline
T = int(readline())
for t in range(T):
	N = int(readline())
	A = list(map(int, readline().split()))
	if N % 2 == 0:
		print('YES')
		continue
	for i in range(N - 1):
		if A[i] >= A[i + 1]:
			print('YES')
			break
	else:
		print('NO')


t = int(input())
for q in range(0, t):
	n = int(input())
	arr = list(map(int, input().split()))
	check = 0
	for i in range(0, n - 1):
		if arr[i] < arr[i + 1]:
			check += 1
	if n & 1 == 0:
		print('YES')
	elif check == n - 1:
		print('NO')
	else:
		print('YES')


import sys
IS_INTERACTIVE = False
input = input
if not IS_INTERACTIVE:
	(*data,) = sys.stdin.read().split('\n')[::-1]

	def input():
		return data.pop()

def fprint(*args, **kwargs):
	print(*args, **kwargs, flush=True)

def eprint(*args, **kwargs):
	print(*args, **kwargs, file=sys.stderr)
for _ in range(int(input())):
	n = int(input())
	(*arr,) = map(int, input().split())
	print('NO' if n % 2 == 1 and sorted(arr) == arr and (len(set(arr)) == n) else 'YES')


def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	flag = False
	for i in range(n - 1):
		if arr[i] >= arr[i + 1]:
			flag = True
	if not flag and n % 2 == 1:
		print('NO')
	else:
		print('YES')
T = int(input())
for _ in range(T):
	solve()


T = int(input())
for _ in range(T):
	N = int(input())
	A = list(map(int, input().split()))
	if N % 2 == 0:
		print('YES')
	else:
		is_IS = True
		for i in range(N - 1):
			if A[i] >= A[i + 1]:
				is_IS = False
				break
		print('NO' if is_IS else 'YES')


def solve(arr, n):
	if n & 1 == 0:
		return 'YES'
	flag = 'NO'
	for i in range(n - 1):
		if arr[i] >= arr[i + 1]:
			flag = 'YES'
			break
	return flag
t = int(input())
for _ in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr, n))


import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time, functools, copy
inf = float('inf')
mod = 10 ** 9 + 7

def LI():
	return [int(x) for x in sys.stdin.readline().split()]

def LF():
	return [float(x) for x in sys.stdin.readline().split()]

def I():
	return int(sys.stdin.readline())

def F():
	return float(sys.stdin.readline())

def S():
	return input()

def LS():
	return input().split()

def endl():
	return print('\n')

def lcm(a, b):
	return a * b // fractions.gcd(a, b)

def grayCode(n):
	return n ^ n >> 1
sys.setrecursionlimit(20000)
graph = collections.defaultdict(list)
grid = []
visited = set()
ways = ['D', 'U', 'R', 'L']
dx = [1, -1, 0, 0]
dy = [0, 0, 1, -1]

def initGraph(m):
	for _ in range(m):
		(u, v) = LI()
		graph[u - 1].append(v - 1)
		graph[v - 1].append(u - 1)

def initGraphW(m):
	for _ in range(m):
		(a, b, c) = LI()
		graph[a - 1].append((b - 1, c))
		graph[b - 1].append((a - 1, c))

def initGrid(h, w):
	for i in range(h):
		s = S()
		grid.append(list(s))
	return grid

def soe(limit):
	a = [True] * limit
	a[0] = a[1] = False
	for (i, isprime) in enumerate(a):
		if isprime:
			yield i
			for n in range(i * i, limit, i):
				a[n] = False
	return a
for _ in range(I()):
	n = I()
	a = LI()
	ok = 1
	for i in range(n - 1):
		ok &= a[i] < a[i + 1]
	if ok == 0 or n % 2 == 0:
		print('yes')
	else:
		print('no')


t = int(input())
for tc in range(t):
	n = int(input())
	a = [int(x) for x in input().split()]
	if n % 2 == 0:
		print('YES')
	else:
		isIncr = True
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				isIncr = False
				break
		if isIncr:
			print('NO')
		else:
			print('YES')


import sys
import io, os
input = sys.stdin.buffer.readline
t = int(input())
for _ in range(t):
	n = int(input())
	A = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		flag = False
		for i in range(n - 1):
			if A[i] >= A[i + 1]:
				flag = True
				break
		if flag:
			print('YES')
		else:
			print('NO')


import os
import sys
from io import BytesIO, IOBase
from bisect import bisect_left
from math import gcd, log, ceil
from collections import Counter
from pprint import pprint
import heapq
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def main():
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		return 'YES'
	for i in range(n - 1):
		if arr[i] >= arr[i + 1]:
			return 'YES'
	return 'NO'
t = int(input())
for _ in range(t):
	ans = main()
	print(ans)


import sys
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep='\n')

def II():
	return int(sys.stdin.readline())

def LI():
	return list(map(int, sys.stdin.readline().split()))

def LLI(rows_number):
	return [LI() for _ in range(rows_number)]

def LI1():
	return list(map(int1, sys.stdin.readline().split()))

def LLI1(rows_number):
	return [LI1() for _ in range(rows_number)]

def SI():
	return sys.stdin.readline().rstrip()
inf = 4294967295
md = 998244353

def solve():
	n = II()
	aa = LI()
	if n & 1 == 0:
		return True
	for i in range(n - 1):
		if aa[i] >= aa[i + 1]:
			return True
	return False
for testcase in range(II()):
	print('YES' if solve() else 'NO')


d = int(input())
while d:
	d -= 1
	size = int(input())
	f = False
	h = list(map(int, input().split()))
	if len(set(h)) % 2 == 0:
		print('YES')
	else:
		for i in range(1, size):
			if h[i] > h[i - 1]:
				continue
			else:
				f = True
				break
		print('YES' if f == True else 'NO')


import math
from itertools import combinations as cm

def gcd(a, b):
	if b == 0:
		return a
	if a > b:
		(a, b) = (b, a)
	return gcd(a, b % a)

def isPrime(x):
	i = 2
	while i * i <= x:
		if x % i == 0:
			return False
		i += 1
	return True

def solve():
	n = inp()
	a = inl()
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				print('YES')
				return
		print('NO')

def inl():
	return [int(i) for i in input().split()]

def inp():
	return int(input())
t = 1
t = inp()
while t:
	solve()
	t -= 1


def fun():
	t = int(input())
	for _ in range(t):
		n = int(input())
		arr = list(map(int, input().split()))
		if n % 2 == 0:
			print('YES')
			continue
		flag = False
		for i in range(1, n):
			if arr[i] <= arr[i - 1]:
				flag = True
				break
		if flag:
			print('YES')
			continue
		print('NO')
fun()


import sys
input = sys.stdin.readline

def main():
	t = int(input())
	for _ in range(t):
		n = int(input())
		ar = list(map(int, input().split()))
		ans = False
		if n % 2:
			for i in range(n - 1):
				if ar[i] >= ar[i + 1]:
					ans = True
					break
			if ans:
				print('YES')
			else:
				print('NO')
		else:
			print('YES')
			continue
main()


import sys
import bisect
import math
inp = sys.stdin.readline
input = lambda : inp().strip()

def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		return 'YES'
	else:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				return 'YES'
		return 'NO'
t = int(input())
for _ in range(t):
	print(solve())


t = int(input())
for i in range(t):
	n = int(input())
	lis = list(map(int, input().split()))
	if len(lis) % 2 == 0:
		print('YES')
	else:
		flag = 1
		for j in range(0, len(lis) - 1):
			if lis[j] >= lis[j + 1]:
				flag = 0
				break
		if flag:
			print('NO')
		else:
			print('YES')


from __future__ import division, print_function
import math
import sys
import os
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')

def print(*args, **kwargs):
	(sep, file) = (kwargs.pop('sep', ' '), kwargs.pop('file', sys.stdout))
	at_start = True
	for x in args:
		if not at_start:
			file.write(sep)
		file.write(str(x))
		at_start = False
	file.write(kwargs.pop('end', '\n'))
	if kwargs.pop('flush', False):
		file.flush()
if sys.version_info[0] < 3:
	(sys.stdin, sys.stdout) = (FastIO(sys.stdin), FastIO(sys.stdout))
else:
	(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def inp():
	return int(input())

def inps():
	return input().strip()

def inlt():
	return list(map(int, input().split()))

def insr():
	s = input().strip()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
for _ in range(inp()):
	n = inp()
	l = inlt()
	if n % 2 == 0:
		print('YES')
	else:
		flag = 0
		for i in range(n - 1):
			if l[i] >= l[i + 1]:
				flag = 1
				break
		if flag:
			print('YES')
		else:
			print('NO')


from sys import stdin, stdout, setrecursionlimit
from io import BytesIO, IOBase
setrecursionlimit(10000)

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		import os
		self.os = os
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None
		self.BUFSIZE = 8192

	def read(self):
		while True:
			a = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			if not a:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(a), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			a = self.os.read(self._fd, max(self.os.fstat(self._fd).st_size, self.BUFSIZE))
			self.newlines = a.count(b'\n') + (not a)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(a), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			self.os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(stdin, stdout) = (IOWrapper(stdin), IOWrapper(stdout))
input = lambda : stdin.readline().rstrip('\r\n')
inp = lambda : int(input())
st = lambda : input().strip()
jn = lambda x, l: x.join(map(str, l))
int_arr = lambda : list(map(int, input().strip().split()))
str_arr = lambda : list(map(str, input().split()))
get_str = lambda : map(str, input().strip().split())
get_int = lambda : map(int, input().strip().split())
get_float = lambda : map(float, input().strip().split())
mod = 1000000007
for _ in range(inp()):
	n = inp()
	a = int_arr()
	f = 0
	if n % 2 == 0:
		print('YES')
	else:
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				print('YES')
				f = 1
				break
		if f == 0:
			print('NO')


import sys
input = lambda : sys.stdin.readline().rstrip('\r\n')
inp_vars_int = lambda : map(int, input().split())
inp_list_int = lambda : list(map(int, input().split()))
t = int(input())
for _ in range(t):
	_ = input()
	a = inp_list_int()
	n = len(a)
	if n % 2:
		pos = False
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				pos = True
				break
		print('YES' if pos else 'NO')
	else:
		print('YES')


T = int(input())
for i in range(T):
	N = int(input())
	arr = list(map(int, input().split()))
	if N % 2 == 0:
		print('YES')
	else:
		for i in range(len(arr) - 1):
			if arr[i] >= arr[i + 1]:
				print('YES')
				break
		else:
			print('NO')


import sys
input = sys.stdin.readline
T = int(input())
for _ in range(T):
	n = int(input())
	data = list(map(int, input().split()))
	if n & 1 == 0:
		print('YES')
	else:
		flg = True
		for i in range(1, len(data)):
			if data[i] <= data[i - 1]:
				flg = False
				break
		if not flg:
			print('YES')
		else:
			print('NO')


import sys
input = sys.stdin.readline

def solve():
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		return 'YES'
	else:
		for i in range(1, n):
			if arr[i] <= arr[i - 1]:
				return 'YES'
		return 'NO'
for _ in range(int(input())):
	print(solve())


test = int(input())
for i in range(test):
	n = int(input())
	lol = list(map(int, input().split()))
	c = 0
	if n % 2 == 0:
		print('YES')
	else:
		for j in range(len(lol) - 1):
			if lol[j] >= lol[j + 1]:
				c += 1
				break
			else:
				c = c
		if c != 0:
			print('YES')
		else:
			print('NO')


from cmath import sqrt
import math
from collections import defaultdict, deque, Counter
from functools import reduce
from sys import stdin
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if n & 1:
		key = 0
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				key = 1
				break
		if key == 0:
			print('NO')
		else:
			print('YES')
	else:
		print('YES')


_ = int(input())
for __ in range(_):
	n = int(input())
	arr = list(map(int, input().split()))
	hit = False
	if len(arr) % 2 == 0:
		print('YES')
		continue
	for i in range(len(arr) - 1):
		if arr[i] >= arr[i + 1]:
			hit = True
			break
	if hit:
		print('YES')
	else:
		print('NO')


import sys
import math
import itertools

def get_line():
	return list(map(int, sys.stdin.readline().strip().split()))

def in1():
	return int(input())
for _ in range(in1()):
	n = in1()
	a = get_line()
	if n % 2 == 0:
		print('YES')
	else:
		p = 0
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				p = 1
				break
		if p == 1:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = [int(x) for x in input().split()]
	i = 0
	ans = 'NO'
	while i < n - 1:
		if a[i] >= a[i + 1]:
			ans = 'YES'
			break
		i += 1
	if ans == 'NO':
		if n % 2 == 0:
			ans = 'YES'
	print(ans)


import sys
inp = sys.stdin.readline()
test = int(inp.strip('\n'))
result = ''
for i in range(test):
	inp = sys.stdin.readline()
	n = int(inp.strip('\n'))
	inp = sys.stdin.readline()
	l = list(map(int, inp.strip('\n').split()))
	if n % 2 == 0:
		sys.stdout.write('YES\n')
	else:
		found = False
		for i in range(n - 1):
			if l[i] >= l[i + 1]:
				found = True
				break
		if found:
			sys.stdout.write('YES\n')
		else:
			sys.stdout.write('NO\n')


import sys
from os import path
if path.exists('input.txt'):
	sys.stdout = open('output.txt', 'w')
	sys.stdin = open('input.txt', 'r')

def main():
	inp = [int(x) for x in sys.stdin.buffer.read().split()]
	ii = 0
	out = []
	t = int(inp[ii])
	ii += 1
	for _ in range(t):
		n = int(inp[ii])
		ii += 1
		arr = inp[ii:ii + n]
		ii += n
		if n % 2 == 0:
			out.append('YES')
			continue
		flag = False
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				flag = True
				break
		if flag:
			out.append('YES')
		else:
			out.append('NO')
		pass
	out_str = '\n'.join((str(x) for x in out))
	sys.stdout.write(out_str)
main()


import os
import sys
from io import BytesIO, IOBase
from sys import maxsize
from itertools import permutations
import math

def arr_input():
	return list(map(int, input().split()))

def mul_input():
	return map(int, input().split())

def int_inp():
	return int(input())
from math import gcd
from collections import Counter
from functools import reduce

def solution():
	n = int_inp()
	a = arr_input()
	if n % 2 != 0 and len(set(a)) == n and (sorted(a) == a):
		print('NO')
	else:
		print('YES')

def main():
	testcases = int(input())
	for _ in range(testcases):
		solution()
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def input():
	return sys.stdin.readline().rstrip('\r\n')
main()


from collections import Counter
for _ in range(int(input())):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		f = 0
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				f = 1
				break
		if f:
			print('YES')
		else:
			print('NO')


for cases in range(int(input())):
	seq = int(input())
	elements_of_seq = list(map(int, input().split()))
	if seq % 2 == 0:
		print('YES')
	else:
		log_bool = False
		min_coef = -1
		for i in elements_of_seq:
			if i <= min_coef:
				log_bool = True
			min_coef = i
		if log_bool == 1:
			print('YES')
		else:
			print('NO')


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if n & 1:
		isit = True
		for i in range(1, n):
			if a[i] <= a[i - 1]:
				isit = False
				break
		if isit:
			print('NO')
			continue
	print('YES')


import bisect
import heapq
import math
import collections
import sys
import copy
from functools import reduce
import decimal
from io import BytesIO, IOBase
import os
import itertools
import functools
from types import GeneratorType
decimal.getcontext().rounding = decimal.ROUND_HALF_UP
graphDict = collections.defaultdict
queue = collections.deque

def bootstrap(f, stack=[]):

	def wrappedfunc(*args, **kwargs):
		to = f(*args, **kwargs)
		if stack:
			return to
		else:
			while True:
				if type(to) is GeneratorType:
					stack.append(to)
					to = next(to)
				else:
					stack.pop()
					if not stack:
						return to
					to = stack[-1].send(to)
	return wrappedfunc

class Graphs:

	def __init__(self):
		self.graph = graphDict(set)

	def add_edge(self, u, v):
		self.graph[u].add(v)
		self.graph[v].add(u)

	def dfs_utility(self, nodes, visited_nodes, colors, parity, level):
		global count
		if nodes == 1:
			colors[nodes] = -1
		elif len(self.graph[nodes]) == 1 and parity % 2 == 0:
			if q == 1:
				colors[nodes] = 1
			else:
				colors[nodes] = -1
				count += 1
		elif parity % 2 == 0:
			colors[nodes] = -1
		else:
			colors[nodes] = 1
		visited_nodes.add(nodes)
		for neighbour in self.graph[nodes]:
			new_level = level + 1
			if neighbour not in visited_nodes:
				self.dfs_utility(neighbour, visited_nodes, colors, level - 1, new_level)

	def dfs(self, node):
		Visited = set()
		color = collections.defaultdict()
		self.dfs_utility(node, Visited, color, 0, 0)
		return color

	def bfs(self, node, f_node):
		count = float('inf')
		visited = set()
		level = 0
		if node not in visited:
			queue.append([node, level])
			visited.add(node)
		flag = 0
		while queue:
			parent = queue.popleft()
			if parent[0] == f_node:
				flag = 1
				count = min(count, parent[1])
			level = parent[1] + 1
			for item in self.graph[parent[0]]:
				if item not in visited:
					queue.append([item, level])
					visited.add(item)
		return count if flag else -1
		return False

class Tree:

	def __init__(self, data):
		self.data = data
		self.left = None
		self.right = None

def inorder(node, lis):
	if node:
		inorder(node.left, lis)
		lis.append(node.data)
		inorder(node.right, lis)
	return lis

def leaf_node_sum(root):
	if root is None:
		return 0
	if root.left is None and root.right is None:
		return root.data
	return leaf_node_sum(root.left) + leaf_node_sum(root.right)

def hight(root):
	if root is None:
		return -1
	if root.left is None and root.right is None:
		return 0
	return max(hight(root.left), hight(root.right)) + 1

class UF:

	def __init__(self, N):
		self._id = list(range(N))
		self._count = N
		self._rank = [0] * N

	def find(self, p):
		id = self._id
		while p != id[p]:
			p = id[p]
		return p

	def count(self):
		return self._count

	def connected(self, p, q):
		return self.find(p) == self.find(q)

	def union(self, p, q):
		id = self._id
		rank = self._rank
		i = self.find(p)
		j = self.find(q)
		if i == j:
			return
		self._count -= 1
		if rank[i] < rank[j]:
			id[i] = j
		elif rank[i] > rank[j]:
			id[j] = i
		else:
			id[j] = i
			rank[i] += 1

	def add_roads(self):
		return set(self._id)

	def __str__(self):
		return ' '.join([str(x) for x in self._id])

	def __repr__(self):
		return 'UF(' + str(self) + ')'

def rounding(n):
	return int(decimal.Decimal(f'{n}').to_integral_value())

def factors(n):
	return set(reduce(list.__add__, ([i, n // i] for i in range(1, int(n ** 0.5) + 1) if n % i == 0)))

def p_sum(array):
	return list(itertools.accumulate(array))

def base_change(nn, bb):
	if nn == 0:
		return [0]
	digits = []
	while nn:
		digits.append(int(nn % bb))
		nn //= bb
	return digits[::-1]

def diophantine(a: int, b: int, c: int):
	(d, x, y) = extended_gcd(a, b)
	r = c // d
	return (r * x, r * y)

@bootstrap
def extended_gcd(a: int, b: int):
	if b == 0:
		(d, x, y) = (a, 1, 0)
	else:
		(d, p, q) = (yield extended_gcd(b, a % b))
		x = q
		y = p - q * (a // b)
	yield (d, x, y)
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self, **kwargs):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))

def inp():
	return sys.stdin.readline().strip()

def map_inp(v_type):
	return map(v_type, inp().split())

def list_inp(v_type):
	return list(map_inp(v_type))
for _ in range(int(inp())):
	n = int(inp())
	arr = list_inp(int)
	if len(arr) & 1:
		temp = list(sorted(arr))
		if arr == temp:
			if len(arr) == len(set(arr)):
				print('NO')
			else:
				print('YES')
		else:
			print('YES')
	else:
		print('YES')


T = int(input())
for _ in range(T):
	n = int(input())
	A = list(map(int, input().split(' ')))
	if n == 1:
		r = False
	elif n % 2 == 0:
		r = True
	else:
		flag = True
		for i in range(n - 1):
			if A[i] >= A[i + 1]:
				flag = False
				break
		if not flag:
			r = True
		else:
			r = False
	print('YES' if r else 'NO')


from os import path, truncate
from sys import int_info, stdin, stdout
if path.exists('tc.txt'):
	stdin = open('tc.txt', 'r')

def gmi():
	return map(int, stdin.readline().strip().split())

def gms():
	return map(str, stdin.readline().strip().split())

def gari():
	return list(map(int, stdin.readline().strip().split()))

def gart():
	return tuple(map(int, stdin.readline().strip().split()))

def gars():
	return list(map(str, stdin.readline().strip().split()))

def gs():
	return stdin.readline().strip()

def gls():
	return list(stdin.readline().strip())

def gi():
	return int(stdin.readline())
for _ in range(int(input())):
	n = gi()
	a = gari()
	if n % 2 != 0 and len(set(a)) == n and (sorted(a) == a):
		print('NO')
	else:
		print('YES')


t = int(input())
for asdfghjkl in range(t):
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		lag = 0
		for i in range(n - 1):
			if arr[i] >= arr[i + 1]:
				lag = 1
				break
		if lag == 1:
			print('YES')
		else:
			print('NO')


for i in range(int(input())):
	n = int(input())
	if n % 2 == 0:
		input()
		print('YES')
	else:
		inn = list(map(int, input().split()))
		for j in range(1, len(inn)):
			if inn[j] <= inn[j - 1]:
				print('YES')
				break
		else:
			print('NO')


t = int(input())
for i in range(t):
	n = int(input())
	a = list(map(int, input().split()))
	test = 0
	i = 1
	while i < n:
		if a[i] <= a[i - 1]:
			test = 1
		i += 1
	if n % 2 == 0 or test == 1:
		print('YES')
	else:
		print('NO')


t = int(input())
answers = list()
for k in range(t):
	n = int(input())
	mas = list(map(int, input().split()))
	if n % 2 == 0:
		answers.append('YES')
		continue
	else:
		solved = False
		for i in range(n - 1):
			(a, b) = (mas[i], mas[i + 1])
			if a >= b:
				answers.append('YES')
				solved = True
				break
		if not solved:
			answers.append('NO')
print('\n'.join(answers))


from math import *
t = int(input())
for _ in range(t):
	n = int(input())
	li = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		f = 0
		for i in range(1, n):
			if li[i] <= li[i - 1]:
				f = 1
				break
		if f == 1:
			print('YES')
		else:
			print('NO')


from collections import Counter, defaultdict, OrderedDict, deque
from bisect import bisect_left, bisect_right
from functools import reduce, lru_cache
from typing import List
import itertools
import math
import heapq
import string
import random
(MIN, MAX, MOD) = (-1061109567, 1061109567, 1000000007)
import os
import sys
from io import BytesIO, IOBase
BUFSIZE = 8192

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')

def RL():
	return map(int, sys.stdin.readline().rstrip().split())

def RLL():
	return list(map(int, sys.stdin.readline().rstrip().split()))

def N():
	return int(input())
for _ in range(N()):
	n = N()
	a = RLL()
	if n & 1:
		flag = False
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				flag = True
				break
		if flag:
			print('YES')
		else:
			print('NO')
	else:
		print('YES')


t = int(input())
while t > 0:
	p = 0
	a = int(input())
	l = list(map(int, input().split()))
	for i in range(0, len(l) - 1, 1):
		if l[i] >= l[i + 1]:
			p = 1
	if p == 1 or a % 2 == 0:
		print('YES')
	else:
		print('NO')
	t -= 1


for _ in range(int(input())):
	res = 'NO'
	n = int(input())
	a = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		continue
	for i in range(1, n):
		if a[i - 1] >= a[i]:
			res = 'YES'
	print(res)


import sys, os, io
import math
from collections import defaultdict

def ii():
	return int(input())

def li():
	return list(map(int, input().split()))
if os.path.exists('input.txt'):
	sys.stdin = open('input.txt', 'r')
	sys.stdout = open('output.txt', 'w')
else:
	input = io.BytesIO(os.read(0, os.fstat(0).st_size)).readline

def solve():
	n = ii()
	a = li()
	if n % 2 == 0:
		print('YES')
		return
	temp = a[:]
	temp.sort()
	if temp != a or len(set(temp)) != len(temp):
		print('YES')
		return
	print('NO')
t = 1
t = ii()
for _ in range(t):
	solve()


for _ in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	if len(a) % 2 == 0:
		print('YES')
	elif len(a) == 1:
		print('NO')
	else:
		ans = 'NO'
		p = a[0]
		for e in a[1:]:
			if e - p <= 0:
				ans = 'YES'
			p = e
		print(ans)


import os
import sys
from io import BytesIO, IOBase
_str = str
str = lambda x=b'': x if type(x) is bytes else _str(x).encode()
BUFSIZE = 8192

def sigma1(a):
	return sum(a)

def sigma2(a):
	return sum([i * i for i in a])

def sigma3(a):
	return sum([i * i * i for i in a])

def prodofpairs(a):
	return (sigma1(a) ** 2 - sigma2(a)) // 2

def prodoftriplets(a):
	return (sigma1(a) ** 3 - 3 * sigma1(a) * sigma2(a) + 2 * sigma3(a)) // 6
from collections import Counter, defaultdict
from math import gcd
from collections import deque

def bfs(graph, start=0):
	used = [False] * len(graph)
	used[start] = True
	q = [start]
	for v in q:
		for w in graph[v]:
			if not used[w]:
				used[w] = True
				q.append(w)

def layers(graph, start=0):
	used = [False] * len(graph)
	used[start] = True
	(q, ret) = ([start], [])
	level = [0] * len(graph)
	while q:
		nq = []
		ret.append(q)
		for v in q:
			for w in graph[v]:
				if not used[w]:
					used[w] = True
					nq.append(w)
					level[w] = 1 + level[v]
		q = nq
	return level
import math

def findMaxGCD(arr, n, k):
	high = max(arr)
	divisors = [0] * (high + 1)
	for i in range(n):
		for j in range(1, int(math.sqrt(arr[i])) + 1):
			if arr[i] % j == 0:
				divisors[j] += 1
				if j != arr[i] // j:
					divisors[arr[i] // j] += 1
	for i in range(high, 0, -1):
		if divisors[i] >= k:
			return i

def xdist(a, b):
	if b[0] >= a[0] >= b[2] or b[0] <= a[0] <= b[2]:
		return 0
	return min(abs(a[0] - b[0]), abs(a[0] - b[2]))

def ydist(a, b):
	if b[1] >= a[1] >= b[3] or b[1] <= a[1] <= b[3]:
		return 0
	return min(abs(a[1] - b[1]), abs(a[1] - b[3]))

def countdistx(i, j, k, obj):
	m = 0
	for i1 in range(k):
		m += xdist([i, j], obj[i1])
	return m

def countdisty(i, j, k, obj):
	m = 0
	for i1 in range(k):
		m += ydist([i, j], obj[i1])
	return m
from bisect import bisect_left

def dp(i, n, cost, a):
	if cost == 0:
		return 0
	if cost < 0:
		return float('Inf')
	l = [float('Inf')]
	for j in range(i, n + 1):
		k = bisect_left(a, a[j] + cost, j)
		if k <= n and a[k] == a[j] + cost:
			l.append(k - j)
	return min(l)

def isp(x):
	for i in range(2, int(math.sqrt(x)) + 1):
		if x % i == 0:
			return False
	return True
from bisect import bisect_right
from sys import stdout
from math import ceil, log2, floor

def main():
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		if n % 2 == 0:
			print('YES')
		else:
			for i in range(n - 1):
				if a[i] >= a[i + 1]:
					print('YES')
					break
			else:
				print('NO')
main()

class FastIO(IOBase):
	newlines = 0

	def __init__(self, file):
		self._fd = file.fileno()
		self.buffer = BytesIO()
		self.writable = 'x' in file.mode or 'r' not in file.mode
		self.write = self.buffer.write if self.writable else None

	def read(self):
		while True:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			if not b:
				break
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines = 0
		return self.buffer.read()

	def readline(self):
		while self.newlines == 0:
			b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
			self.newlines = b.count(b'\n') + (not b)
			ptr = self.buffer.tell()
			(self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr))
		self.newlines -= 1
		return self.buffer.readline()

	def flush(self):
		if self.writable:
			os.write(self._fd, self.buffer.getvalue())
			(self.buffer.truncate(0), self.buffer.seek(0))

class IOWrapper(IOBase):

	def __init__(self, file):
		self.buffer = FastIO(file)
		self.flush = self.buffer.flush
		self.writable = self.buffer.writable
		self.write = lambda s: self.buffer.write(s.encode('ascii'))
		self.read = lambda : self.buffer.read().decode('ascii')
		self.readline = lambda : self.buffer.readline().decode('ascii')
(sys.stdin, sys.stdout) = (IOWrapper(sys.stdin), IOWrapper(sys.stdout))
input = lambda : sys.stdin.readline().rstrip('\r\n')


def func():
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		return 'YES'
	flg = False
	for i in range(n - 1):
		if l[i] >= l[i + 1]:
			flg = True
			break
	if flg:
		return 'YES'
	return 'NO'
t = int(input())
for i in range(t):
	print(func())


t = int(input())
res = []

def sorted(l):
	for i in range(1, len(l)):
		if l[i] <= l[i - 1]:
			return False
	return True
for i in range(t):
	n = int(input())
	l = input().split()
	l = [int(i) for i in l]
	if n % 2 == 0:
		res.append('YES')
	elif not sorted(l):
		res.append('YES')
	else:
		res.append('NO')
for i in res:
	print(i)


tc = int(input())
for q in range(tc):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		f = 0
		for i in range(1, n):
			pre = l[i - 1]
			cur = l[i]
			if pre >= cur:
				f = 1
				break
		if f == 1:
			print('YES')
		else:
			print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	arr = [int(j) for j in input().split()]
	flag = 0
	for i in range(n - 1):
		if arr[i] == arr[i + 1]:
			flag = 1
			break
	if flag == 1:
		print('YES')
		continue
	s = arr[:]
	s.sort()
	if arr == s and n % 2 == 1:
		print('NO')
	else:
		print('YES')


def solve(arr):
	if len(arr) % 2 == 0:
		return 'YES'
	for i in range(len(arr) - 1):
		if arr[i] >= arr[i + 1]:
			return 'YES'
	return 'NO'
T = int(input())
for _ in range(T):
	n = int(input())
	arr = list(map(int, input().split()))
	print(solve(arr))


import sys
inp = sys.stdin.readline

def solve():
	n = int(inp())
	a = list(map(int, inp().split()))
	if n % 2 == 0:
		print('YES')
		return
	for i in range(1, n):
		if a[i] <= a[i - 1]:
			print('YES')
			return
	print('NO')

def main():
	for i in range(int(inp())):
		solve()
main()


def solve():
	n = int(input())
	a = list(map(int, input().split()))
	if n & 1:
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				return 'YES'
		return 'NO'
	else:
		return 'YES'
for _ in range(int(input())):
	print(solve())


import math
from collections import defaultdict, Counter
from bisect import bisect_left
from sys import stdin
from math import gcd
from functools import reduce
import itertools

def find():
	n = int(input())
	arr = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
		return
	else:
		for i in range(1, n):
			if arr[i] <= arr[i - 1]:
				print('YES')
				return
		for i in range(1, n):
			print('NO')
			return
input = stdin.readline
t = int(input())
for _ in range(t):
	find()


import sys
import string
from decimal import Decimal
from math import log

def inp():
	return int(input())

def inplist():
	return list(map(int, input().split()))

def inpstrlist():
	s = input()
	return list(s[:len(s)])

def invr():
	return map(int, input().split())
t = int(input())
for _ in range(t):
	n = inp()
	arr = inplist()
	if n % 2 == 0:
		print('YES')
		continue
	f = 0
	for i in range(1, n):
		if arr[i - 1] >= arr[i]:
			f = 1
			break
	if f == 1:
		print('YES')
	else:
		print('NO')


import math
from sys import stdin
from collections import Counter, deque
input = stdin.readline
for _ in range(int(input())):
	n = int(input())
	a = [int(i) for i in input().split()]
	if n & 1:
		key = 0
		for i in range(n - 1):
			if a[i] >= a[i + 1]:
				print('YES')
				key = 1
				break
		if key == 0:
			print('NO')
	else:
		print('YES')


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	if n % 2 == 0:
		print('YES')
	else:
		x = l.copy()
		x.sort()
		if l == x:
			if len(set(l)) == len(l):
				print('NO')
			else:
				print('YES')
		else:
			print('YES')