#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    bool able = false;
    long long sum = 0;
    for (int i = 1; i < n; i++) {
      sum += max(a[i] - a[i - 1], 0);
    }
    able = sum <= a[n - 1];
    puts(able ? "YES" : "NO");
  }
  return 0;
}
