#include <bits/stdc++.h>
using namespace std;
long long int mod = 1e9 + 7;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t = 1;
  cin >> t;
  while (t--) {
    long long int temp = 0, flag = 1, ans = 0, maxo = 1e9 + 7, mino = -1e9 - 7;
    long long int n;
    cin >> n;
    long long int A[n];
    for (long long int i = 0; i < n; i++) cin >> A[i];
    temp = A[0];
    for (long long int i = 0; i < n - 1; i++) {
      if (A[i] > A[i + 1]) temp -= A[i] - A[i + 1];
    }
    if (temp < 0)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
