#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n, x;
    cin >> n >> x;
    int p = x;
    for (int i = 1; i < n; i++) {
      int y;
      cin >> y;
      if (x - y > 0) p -= x - y;
      x = y;
    }
    if (p >= 0)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
