#include <bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VL = vector<LL>;
using PII = pair<int, int>;
using PLL = pair<LL, LL>;
void dout() { cerr << endl; }
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
  cerr << H << ' ';
  dout(T...);
}
void solve() {
  int n;
  cin >> n;
  VI a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  int x = 0, y = INT_MAX;
  for (int i = 0; i < n; ++i) {
    int nx = max(x, a[i] - y);
    int ny = a[i] - nx;
    x = nx;
    y = ny;
    if (y < 0) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
