#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>

using namespace std;

#define int long long

int inf = 100000000000000;

mt19937 rnd_(12);

bool checer(vector <int> a) {
    bool f = true;

    int n = a.size();
    for (int i = 1; i < n - 1 ; i++) {
        if (a[i]*2 > a[i -1] + a[i+1])
            f = false;
    }

    return f;
}


signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);


    int times;
    cin >> times;

    while (times--) {

        int n;
        cin >> n;

        vector <int> a (n);

        for (int i = 0 ; i < n; i++)
            cin >> a[i];

        bool ans = false;

        for (int i = 1 ; i < n-  1; i++) {
            if (a[i]*2 > a[i - 1] +a[i+1]) {
                vector <int> b;
                b.push_back(a[i]);
                for (int j= 0 ; j < n ; j++) {
                    if (j != i)
                        b.push_back(a[j]);
                }

                ans= max(ans , checer(b));

                b.clear();

                b.push_back(a[i+1]);
                for (int j= 0 ; j < n ; j++) {
                    if (j != i+1)
                        b.push_back(a[j]);
                }

                ans= max(ans , checer(b));

                break;
            }
        }

        ans = max(ans , checer(a));

        if (ans == true)
            cout << "YES\n";
        else
            cout <<"NO\n";
    }
}