#include <bits/stdc++.h>
using namespace std;
int N;
int a[30000];
void solve() {
  int left = 0;
  for (int i = 0; i < N; i++) {
    if (i == 0 || a[i] <= a[i - 1])
      left++;
    else
      break;
  }
  int right = N - 1;
  for (int i = N - 1; i >= 0; i--) {
    if (i == N - 1 || a[i] <= a[i + 1])
      right--;
    else
      break;
  }
  for (int i = left; i <= right; i++) {
    if (a[i] > a[left - 1] + a[right + 1]) {
      cout << "NO" << endl;
      return;
    }
  }
  int bound = a[right] - a[right + 1], bottom = a[left - 1],
      top = a[left] - a[left - 1];
  for (int i = left; i <= right; i++) {
    while (a[i] - bottom < top) {
      bottom--;
      if (bottom < bound) {
        cout << "NO" << endl;
        return;
      }
    }
    top = a[i] - bottom;
  }
  cout << "YES" << endl;
}
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    cin >> N;
    for (int j = 0; j < N; j++) cin >> a[j];
    solve();
  }
}
