#include <bits/stdc++.h>
using namespace std;
int main() {
  int numtests;
  cin >> numtests;
  list<vector<int>> tests;
  int numvariables = 1;
  int *variables = new int[numtests * numvariables];
  for (int i = 0; i < numtests; i++) {
    cin >> variables[i * numvariables];
    vector<int> tempvector;
    for (int j = 0; j < variables[i * numvariables]; j++) {
      int temp;
      cin >> temp;
      tempvector.push_back(temp);
    }
    tests.push_back(tempvector);
  }
  int testnumber = 0;
  auto testsiter = tests.begin();
  for (; testnumber < numtests; testsiter++, testnumber++) {
    auto numnums = variables[(testnumber * numvariables)];
    auto test = *testsiter;
    vector<long long int> leftdrop(numnums, 0);
    vector<long long int> rightdrop(numnums, 0);
    long long int cumleftdrop = 0;
    long long int cumrightdrop = 0;
    if (numnums == 0) {
      cout << "YES" << endl;
      continue;
    }
    for (int i = 1; i < numnums; i++) {
      long long int drop = test[i] - test[i - 1];
      if (drop > 0) {
        cumrightdrop += drop;
      }
      rightdrop[i] = cumrightdrop;
    }
    for (int i = numnums - 2; i > -1; i--) {
      long long int drop = test[i] - test[i + 1];
      if (drop > 0) {
        cumleftdrop += drop;
      }
      leftdrop[i] = cumleftdrop;
    }
    bool passed = true;
    for (int i = 0; i < numnums; i++) {
      if (test[i] < (leftdrop[i] + rightdrop[i])) {
        passed = false;
      }
    }
    if (passed) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  free(variables);
}
