#include <bits/stdc++.h>
using namespace std;
int t, n, a[200010];
int A[200010], B[200010];
int main() {
  ios::sync_with_stdio(false);
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    B[1] = a[1], A[1] = 0;
    for (int i = 2; i <= n; i++) {
      B[i] = min(B[i - 1], a[i] - A[i - 1]);
      A[i] = a[i] - B[i];
    }
    bool f = 0;
    for (int i = 1; i <= n; i++)
      if (B[i] < 0) f = 1;
    if (f == 1)
      cout << "NO" << '\n';
    else
      cout << "YES" << '\n';
  }
  return 0;
}
