#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  int T;
  cin >> T;
  while (T--) {
    int N;
    cin >> N;
    vector<int> A(N);
    for (auto &a : A) {
      cin >> a;
    }
    int a = A[0];
    for (int i = 1; i < N; ++i) {
      if (A[i - 1] > A[i]) {
        a -= (A[i - 1] - A[i]);
      }
    }
    if (a < 0) {
      cout << "NO"
           << "\n";
    } else {
      cout << "YES"
           << "\n";
    }
  }
  return 0;
}
