#include <bits/stdc++.h>
using namespace std;
int xm[4] = {-1, 1, 0, 0};
int ym[4] = {0, 0, -1, 1};
const int MOD = 1e9 + 7;
const int MAXN = 5e5 + 5;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long a[n];
    for (int i = 0; i < n; i++) cin >> a[i];
    long long s1 = 0;
    long long s2 = 0;
    for (int i = 1; i < n; i++) {
      if (a[i] > a[i - 1])
        s1 += a[i] - a[i - 1];
      else
        s2 += a[i - 1] - a[i];
    }
    if (s1 <= a[n - 1] && s2 <= a[0])
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
