#include <bits/stdc++.h>
using namespace std;
const long long base = 131;
const long long mod = 998244353;
int a[105000];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    int x = 0, y = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      if (i == 1)
        x = a[i];
      else if (a[i] - a[i - 1] < 0)
        y += abs(a[i] - a[i - 1]);
    }
    if (x < y) {
      printf("NO\n");
    } else
      printf("YES\n");
  }
}
