#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    int l = inf, r = 0;
    bool flag = 1;
    for (int i = 1; i <= n; i++) {
      int x;
      cin >> x;
      if (r > x) flag = false;
      l = min(l, x - r);
      r = x - l;
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
