#include <bits/stdc++.h>
using namespace std;
int main() {
  int tcases;
  cin >> tcases;
  for (int jj = 0; jj < tcases; ++jj) {
    int n;
    cin >> n;
    int maxdec = 10000000, mininc = 0;
    int flag = true;
    for (int i = 0; i < n; ++i) {
      int x;
      cin >> x;
      if (x < mininc || !flag) {
        flag = false;
        continue;
      }
      mininc = max(mininc, x - maxdec);
      maxdec = min(maxdec, x - mininc);
    }
    if (!flag)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
