#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
long long powmod(long long x, long long y) {
  if (y == 0) return 1;
  long long p = powmod(x, y / 2) % 998244353;
  p = (p * p) % 998244353;
  return (y % 2 == 0) ? p : (x * p) % 998244353;
}
long long inverse(long long a) { return powmod(a, 998244353 - 2); }
const long long limbin = 500001;
long long fact[limbin], factinv[limbin], coefficientflag = 0;
void Util_nCr() {
  fact[0] = 1, factinv[0] = 1;
  for (long long i = 1; i < limbin; i++) {
    fact[i] = (fact[i - 1] * i) % 998244353;
    factinv[i] = (factinv[i - 1] * inverse(i)) % 998244353;
  }
}
long long nCr(long long n, long long r) {
  if (!coefficientflag) coefficientflag = 1, Util_nCr();
  if (n < r) return 0;
  return ((fact[n] * inverse(fact[n - r]) % 998244353 * inverse(fact[r])) %
          998244353);
}
void solve() {
  long long n;
  cin >> n;
  long long a[n];
  for (long long i = 0; i < n; i++) cin >> a[i];
  for (long long i = n - 1; i >= 1; i--) a[i] -= a[i - 1];
  long long sum = 0;
  for (long long i = 0; i < n; i++) sum -= (a[i] < 0) * a[i];
  cout << ((sum > a[0]) ? "NO\n" : "YES\n");
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t = 1;
  cin >> t;
  for (long long i = 0; i < t; i++) {
    solve();
  }
}
