#include <bits/stdc++.h>
using namespace std;
const long long N = 500000;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v(n), left(n), right(n);
    for (long long i = 0; i < n; i++) cin >> v[i];
    long long f = 0;
    left[0] = v[0];
    long long diff = 0;
    for (long long i = 1; i < n; i++) {
      diff += max((long long)0, v[i] - v[i - 1]);
      left[i] = v[i] - diff;
    }
    right[n - 1] = v[n - 1];
    diff = 0;
    for (long long i = n - 2; i >= 0; i--) {
      diff += max((long long)0, v[i] - v[i + 1]);
      right[i] = v[i] - diff;
    }
    if (left[n - 1] >= 0 || right[0] >= 0) f = 1;
    for (long long i = 0; i < n - 1; i++) {
      long long l = v[i] - left[i];
      long long r = v[i + 1] - right[i];
      if (right[i + 1] >= l && left[i] >= r) f = 1;
    }
    if (f)
      cout << "YES"
           << "\n";
    else
      cout << "NO"
           << "\n";
  }
}
