#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
template <typename T>
ostream &operator+(ostream &out, const vector<T> &vec) {
  for (const auto &x : vec) {
    out << x << " ";
  }
  out << "\n";
  return out;
}
template <typename T>
ostream &operator*(ostream &out, const vector<T> &vec) {
  for (const auto &x : vec) {
    out + x;
  }
  return out;
}
template <typename T>
istream &operator>>(istream &in, vector<T> &vec) {
  for (auto &x : vec) {
    in >> x;
  }
  return in;
}
void solve() {
  int n;
  cin >> n;
  vector<int> seq(n);
  cin >> seq;
  int l = 1e9, r = 0;
  for (const auto &x : seq) {
    if (x < r + l) {
      l = x - r;
      if (l < 0) {
        cout << "NO\n";
        return;
      }
    }
    if (x > r + l) {
      r = x - l;
    }
  }
  cout << "YES\n";
  return;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
}
