0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-11-27 17:56:28 +00:00
OI-codes/Codeforces/1604/B/B.cpp
2022-04-01 18:33:24 +08:00

26 lines
489 B
C++

#include <bits/stdc++.h>
using namespace std;
int t, n, a[100005];
int main() {
cin >> t;
while (t--) {
bool flag = false;
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
}
if (n % 2 == 0) {
cout << "YES" << endl;
continue;
}
for (int i = 1; i < n; i++) {
flag = flag || a[i] >= a[i + 1];
}
cout << (flag ? "YES" : "NO") << endl;
}
return 0;
}