#include <bits/stdc++.h>
using namespace std;
using lli = long long;
using ull = unsigned long long;
using ldb = long double;
const lli N = 1e3 + 5;
const lli maxN = 1e6 + 5;
const lli mod = 1e9 + 7;
const lli infty = 1e10;
const double ep = 0.000001;
const lli logn = 18;
const lli Block_size = 500;
const long long base = 315;
long long sub[maxN];
void InputFile() {}
void FastInput() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
}
long long n;
long long a[maxN];
long long pre, suf;
void Read() {
  cin >> n;
  pre = 0;
  suf = 0;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
}
void Solve() {
  for (long long i = 2; i <= n; i++) {
    if (a[i] > a[i - 1])
      suf += a[i] - a[i - 1];
    else
      pre += a[i - 1] - a[i];
  }
  if (pre <= a[1] && suf <= a[n])
    cout << "YES" << '\n';
  else
    cout << "NO" << '\n';
}
void Debug() {}
signed main() {
  FastInput();
  long long test;
  cin >> test;
  while (test--) {
    Read();
    Solve();
    Debug();
  }
}
