#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#pragma GCC target("avx2")
#pragma optimize("JARU SOSISONI")
using namespace std;
const long long INF = 1e18 + 100;
const long long MOD1 = 998244353;
const long long MOD = 1e9 + 7;
const long long N = 400;
const long long nul = 0;
const long long SIZE = 1e6 * 3;
const long long LOG = 32;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  ;
  long long q;
  cin >> q;
  while (q--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    for (long long &i : a) cin >> i;
    long long cnt = 0;
    bool flag = 1;
    for (long long i = 0; i < n - 1; i++) {
      if (a[i] < cnt) flag = 0;
      if (a[i] < a[i + 1]) cnt += a[i + 1] - a[i];
    }
    if (a[n - 1] < cnt) flag = 0;
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
