#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
int main() {
  int t, n, x;
  vector<int> v;
  cin >> t;
  while (t--) {
    cin >> n;
    v.clear();
    for (int i = 0; i < n; i++) {
      cin >> x;
      v.push_back(x);
    }
    if (n <= 2) {
      cout << "YES" << endl;
      continue;
    }
    int aux = 0;
    for (int i = 1; i < n; i++) {
      v[i] -= aux;
      if (v[i] > v[i - 1]) {
        aux += v[i] - v[i - 1];
        v[i] = v[i - 1];
      }
    }
    bool ok = true;
    for (int i = 0; i < n; i++) {
      if (v[i] < 0) {
        ok = false;
      }
    }
    if (ok) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
  return 0;
}
