#include <bits/stdc++.h>
using namespace std;
const long long N = 2e5 + 5;
const long long mod = 1e9 + 7;
long long num[N];
long long a[N];
long long b[N];
long long ans[N];
signed main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  long long T = 1;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    for (long long i = 1; i <= n; i++) cin >> num[i];
    a[1] = num[1] - 1, b[1] = 1;
    for (long long i = 2; i <= n; i++) {
      a[i] = min(a[i - 1], num[i] - b[i - 1]);
      b[i] = num[i] - a[i];
    }
    bool flag = true;
    long long ma = *min_element(a + 1, a + 1 + n);
    long long mb = *min_element(b + 1, b + n + 1);
    if (ma + mb < 0) flag = false;
    cout << (flag ? "YES\n" : "NO\n");
  }
  return 0;
}
