#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 10;
int a[N];
int ans[N];
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    a[0] = 0;
    for (int i = 1; i <= n; i++) {
      scanf("%d", &a[i]);
      ans[i] = a[i] - a[i - 1];
    }
    int res = 0;
    for (int i = 2; i <= n; i++)
      if (ans[i] < 0) res = res + (-1) * ans[i];
    if (res <= a[1])
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
