#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 10;
int t, n, v[N], a[N], b[N];
int main() {
  ios::sync_with_stdio(0);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; ++i) {
      cin >> v[i];
    }
    a[1] = v[1];
    b[1] = 0;
    bool f = 1;
    for (int i = 2; i <= n; ++i) {
      a[i] = min(a[i - 1], v[i] - b[i - 1]);
      b[i] = v[i] - a[i];
      if (a[i] < 0) {
        f = 0;
        break;
      }
    }
    if (f)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
