#include <bits/stdc++.h>
using namespace std;
inline int qread() {
  int x = 0;
  char c = getchar(), o = ' ';
  while (c < '0' || c > '9') o = c, c = getchar();
  while (c >= '0' && c <= '9')
    x = (x << 3) + (x << 1) + (c ^ 48), c = getchar();
  if (o == '-') x = ~x + 1;
  return x;
}
int a[100010], l[100010], r[100010];
int Max(int x, int y) { return x > y ? x : y; }
int main() {
  int t = qread();
  while (t--) {
    int n = qread();
    memset(a, 0, sizeof(int) * n);
    for (register int i = 1; i <= n; ++i) a[i] = qread();
    int ans = 0;
    for (register int i = 1; i < n; ++i) {
      ans += Max(a[i] - a[i + 1], 0);
    }
    if (ans > a[1])
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
