#include <bits/stdc++.h>
using namespace std;
void start() {}
bool comp(pair<long long, long long>& a, pair<long long, long long>& b) {
  if (a.first < b.first) return 1;
  return 0;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    long long a[n];
    for (long long i = 0; i < n; i++) cin >> a[i];
    long long c[n], d[n];
    for (long long i = 0; i < n; i++) {
      if (i == 0)
        c[i] = a[i];
      else
        c[i] = c[i - 1] - max(0ll, a[i - 1] - a[i]);
    }
    for (long long i = n - 1; i >= 0; i--) {
      if (i == n - 1)
        d[i] = a[i];
      else
        d[i] = d[i + 1] - max(0ll, a[i + 1] - a[i]);
    }
    long long g = 0;
    if (c[n - 1] >= 0 || d[0] >= 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
