#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0, f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = 0;
    c = getchar();
  }
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  return f ? x : -x;
}
const int N = 3e4 + 10;
int T, n, a[N], c[N], ans;
int main() {
  T = read();
  while (T--) {
    n = read();
    for (int i = 1; i <= n; i++) {
      a[i] = read();
      c[i] = a[i] - a[i - 1];
    }
    ans = 0;
    for (int i = 2; i <= n; i++)
      if (c[i] < 0) ans += -c[i];
    puts(ans <= c[1] ? "YES" : "NO");
  }
  return 0;
}
