#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 1000;
int t, n;
int a[N], b[N];
int main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    for (int i = 1; i <= n; i++) b[i] = a[i] - a[i - 1];
    int res = 0;
    for (int i = 2; i <= n; i++) {
      if (b[i] < 0) res += (-b[i]);
    }
    if (res <= a[1])
      puts("YES");
    else
      puts("NO");
  }
}
