#include <bits/stdc++.h>
using i64 = long long;
using u64 = unsigned long long;
using u32 = unsigned;
const int N = 1e5 + 10;
int n;
int a[N];
int main() {
  int t;
  std::cin >> t;
  while (t--) {
    std::cin >> n;
    for (int i = 1; i <= n; ++i) std::cin >> a[i];
    for (int i = n; i >= 1; --i) a[i] -= a[i - 1];
    int sum = 0;
    for (int i = 2; i <= n; ++i) {
      if (a[i] < 0) {
        sum -= a[i];
      }
    }
    if (a[1] >= sum)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
