#include <bits/stdc++.h>

using namespace std;

vector<string> split_string(string);

/*
 * Complete the canModify function below.
 */
string canModify(vector<int> a) {
    for (int i = 0; i < a.size(); i++) {
        vector <int> cur = a;
        cur.erase(cur.begin() + i);
        int j = 0;
        for (j = 0; j + 1 < cur.size(); j++)
            if (cur[j] > cur[j + 1]) break;
        if (j + 1 >= cur.size()) return "YES";
    }
    return "NO";
}

int main()
{
int t; scanf("%d", &t);
    while (t--) {
    int n;
    cin >> n;
    vector <int> res(n);
    for (int i = 0; i < n; i++)
        scanf("%d", &res[i]);
    cout << canModify(res) << endl;
    }
    return 0;
}