#include <bits/stdc++.h>
using namespace std;
long long int max(long long int a, long long int b) { return a > b ? a : b; }
long long int min(long long int a, long long int b) { return a < b ? a : b; }
const int N = 1e5 + 1;
int a[N];
long long int kedane(int start, int end) {
  int ind = start;
  long long int sm = 0, mx = 0;
  while (ind < end) {
    sm += a[ind++];
    if (sm < 0) {
      sm = 0;
    }
    mx = max(mx, sm);
  }
  return mx;
}
void solve() {
  int n;
  scanf("%d", &n);
  long long int ts = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &a[i]);
    ts += a[i];
  }
  long long int kd = max(kedane(0, n - 1), kedane(1, n));
  if (kd >= ts) {
    cout << "NO\n";
  } else
    cout << "YES\n";
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) solve();
  return 0;
}
