#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 7;
signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(0);
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> a(n);
    bool good = false;
    long long Min = inf, last = inf;
    for (long long i = 0; i < n; i++) {
      cin >> a[i];
      if (last > a[i]) {
        Min -= last - a[i];
      }
      last = a[i];
    }
    if (Min < 0)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
}
