#include <bits/stdc++.h>
using namespace std;
const int N = 3e4 + 5;
long long t, n;
long long a[N], cf[N];
signed main() {
  scanf("%d", &t);
  while (t--) {
    scanf("%d", &n);
    long long sum = 0;
    for (long long i = 1; i <= n; ++i)
      scanf("%d", &a[i]), cf[i] = a[i] - a[i - 1];
    for (long long i = 1; i <= n; ++i)
      if (cf[i] < 0) sum -= cf[i];
    if (cf[1] >= sum)
      puts("YES");
    else
      puts("NO");
  }
}
