#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<long long> v(n + 2), a(n + 1), b(n + 2);
    for (int i = 1; i <= (n); i++) cin >> v[i];
    a[1] = v[1];
    b[1] = 0;
    bool ok = true;
    for (int i = 2; i <= n; i++) {
      a[i] = min(a[i - 1], v[i]);
      b[i] = v[i] - a[i];
      if (b[i] >= b[i - 1]) continue;
      b[i] = b[i - 1];
      a[i] = v[i] - b[i];
      if (a[i] < 0) {
        ok = false;
        break;
      }
    }
    cout << (ok ? "Yes" : "No") << endl;
  }
}
