#include <bits/stdc++.h>
using namespace std;
const int maxn = 30000 + 10;
long long int nums[maxn], diff[maxn];
int main() {
  int kase;
  scanf("%d", &kase);
  while (kase--) {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++) scanf("%lld", &nums[i]);
    diff[0] = nums[0];
    long long int negativesum = 0;
    for (int i = 1; i < n; i++) {
      diff[i] = nums[i] - nums[i - 1];
      if (diff[i] < 0) negativesum += abs(diff[i]);
    }
    if (negativesum <= diff[0])
      printf("YES\n");
    else
      printf("NO\n");
  }
}
