#include <bits/stdc++.h>
using namespace std;
int t;
void solve();
int main() {
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
void solve() {
  int n;
  cin >> n;
  vector<int> arr(n);
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  for (int i = 0; i < n - 1; i++) {
    sum += max(0, arr[i] - arr[i + 1]);
  }
  if (sum <= arr[0])
    cout << "YES";
  else
    cout << "NO";
  cout << "\n";
}
