#include <bits/stdc++.h>
using namespace std;
void Input_Preparing() {}
void Solver() {
  int n;
  cin >> n;
  vector<int> a(n + 1), L = a, R = a;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  int Max = 0, Small = a[1];
  bool aws = 1;
  for (int i = 2; i <= n; ++i) {
    Max = max(L[i - 1], a[i] - Small);
    L[i] = Max;
    if (a[i] - Max < 0) aws = 0;
    Small = a[i] - L[i];
  }
  if (aws)
    cout << "YES"
         << "\n";
  else
    cout << "NO"
         << "\n";
  return;
}
void Processing() {
  int t;
  cin >> t;
  while (t--) {
    Solver();
  }
}
int main() {
  std::cin.tie(0)->sync_with_stdio(0);
  ;
  Processing();
  return 0;
}
