#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e4 + 5;
int a[maxn];
int ans[maxn];
int main() {
  int _;
  cin >> _;
  while (_--) {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
      cin >> a[i];
      ans[i] = a[i] - a[i - 1];
    }
    int res = 0;
    for (int i = 2; i <= n; i++) {
      if (ans[i] < 0) res = res + (-1) * ans[i];
    }
    if (res <= a[1])
      cout << "yes" << endl;
    else
      cout << "no" << endl;
  }
  return 0;
}
