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