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