#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y, long long p) {
  long long res = 1;
  x = x % p;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int a[n];
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
    }
    int m = a[0];
    int s[n];
    s[0] = a[0];
    for (long long i = 1; i < n; i++) {
      s[i] = a[i] - a[i - 1];
    }
    for (long long i = 1; i < n; i++) {
      if (s[i] < 0 && m + s[i] >= 0) {
        m += s[i];
        s[i] = 0;
      }
    }
    bool flag = true;
    for (long long i = 0; i < n; i++) {
      if (s[i] < 0) {
        flag = false;
      }
    }
    if (flag)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
