#include <bits/stdc++.h>
using namespace std;
long long int mod = 998244353LL;
vector<long long int> a, b;
long long int n;
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v(n), a(n), b(n);
  for (long long int i = 0; i < n; i++) cin >> v[i];
  a[0] = v[0];
  b[n - 1] = v.back();
  for (long long int i = 1; i < n - 1; i++) {
    long long int a2 = a[i - 1], b2 = b[i - 1];
    if (v[i] - a2 >= b2 && v[i] - a2 <= b.back()) {
      a[i] = a2;
      b[i] = v[i] - a2;
    } else if (v[i] - b2 <= a2 && v[i] - b2 >= 0) {
      a[i] = v[i] - b2;
      b[i] = b2;
    } else {
      cout << "NO"
           << "\n";
      return;
    }
  }
  cout << "YES"
       << "\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long int t = 1;
  cin >> t;
  for (long long int i = 0; i < t; i++) {
    solve();
  }
}
