#include <bits/stdc++.h>
using namespace std;
int t, n;
int a[31234];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> t;
  while (t--) {
    cin >> n;
    int sub = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
    }
    if (n == 1) {
      cout << "YES\n";
      continue;
    }
    bool ok = true;
    for (int i = 1; i < n; ++i) {
      if (a[i] > a[i - 1]) {
        sub += (a[i] - a[i - 1]);
      }
      if (sub > a[i]) {
        ok = false;
        break;
      }
    }
    if (ok)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
