#include <bits/stdc++.h>
using namespace std;
long long int me(long long int x, long long int n) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return me((x * x) % 1000000007, n / 2);
  else
    return (x * me((x * x) % 1000000007, (n - 1) / 2)) % 1000000007;
}
bool IsPrime(long long int n) {
  if (n <= 1) return false;
  if (n <= 3) return true;
  if (n % 2 == 0 || n % 3 == 0) return false;
  for (long long int i = 5; i * i <= n; i = i + 6)
    if (n % i == 0 || n % (i + 2) == 0) return false;
  return true;
}
void solve() {
  long long int n;
  cin >> n;
  long long int a[n];
  for (long long int i = 0; i < n; i++) {
    cin >> a[i];
  };
  long long int one[n], two[n];
  one[0] = a[0];
  two[0] = 0;
  for (long long int i = 1; i < n; i++) {
    one[i] = min(one[i - 1], a[i] - two[i - 1]);
    two[i] = a[i] - one[i];
    if (two[i] < 0 || one[i] < 0) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
signed main() {
  ios_base::sync_with_stdio(false);
  long long int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
