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