#include <bits/stdc++.h>
using namespace std;
const int N = 31000;
int t, n;
int a[N];
int b[N];
int main() {
  cin >> t;
  while (t--) {
    cin >> n;
    for (int i = 1; i <= n; i++) scanf("%d", a + i);
    for (int i = 1; i <= n; i++) b[i] = a[i] - a[i - 1];
    int ans = 0;
    for (int i = 2; i <= n; i++) {
      if (b[i] < 0) ans += (-1) * b[i];
    }
    if (ans > a[1])
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
