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