#include <bits/stdc++.h>
using namespace std;
const int maxn = 30000;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    int a[maxn], b[maxn];
    int sum = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      b[i] = a[i] - a[i - 1];
    }
    for (int i = 1; i < n; i++) {
      if (b[i] < 0) sum -= b[i];
    }
    if (a[0] >= sum)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
