#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 10;
int a[N], n, t, res;
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    res = 0;
    for (int i = 0; i < n; ++i) {
      cin >> a[i];
      if (i && a[i] - a[i - 1] < 0) res += a[i - 1] - a[i];
    }
    puts((res > a[0] ? "NO" : "YES"));
  }
  return 0;
}
