#include <bits/stdc++.h>
using namespace std;
const long long int inf = 1e18;
void solve() {
  int n;
  cin >> n;
  vector<long long int> v(n);
  for (long long int &x : v) cin >> x;
  long long int p = 0, ng = 0;
  for (int i = 1; i < n; i++)
    (v[i - 1] < v[i] ? p : ng) += abs(v[i] - v[i - 1]);
  cout << (ng <= v.front() && p <= v.back() ? "YES\n" : "NO\n");
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) solve();
}
