#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a;
  cin >> a;
  int b[a];
  for (int i = 0; i < a; i++) {
    cin >> b[i];
  }
  int ind = 0;
  for (int i = 0; i < a - 1; i++) {
    if (b[i] > b[i + 1]) {
      b[0] = b[0] - b[i] + b[i + 1];
      if (b[0] < 0) {
        cout << "NO";
        return;
      }
    }
  }
  cout << "YES";
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << endl;
  }
}
