#include <bits/stdc++.h>
using namespace std;
int n, t, a[30001];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> t;
  while (t--) {
    int s = 0;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = n; i >= 2; i--) a[i] -= a[i - 1];
    for (int i = 2; i <= n; i++) s -= min(a[i], 0);
    cout << (s > a[1] ? "NO" : "YES") << "\n";
  }
  return 0;
}
