#include <bits/stdc++.h>
using namespace std;
long long func(vector<long long> &v, long long start, long long end) {
  long long max_end = v[start], cur_max = v[start];
  for (long long i = start + 1; i <= end; i++) {
    cur_max = max(v[i], cur_max + v[i]);
    max_end = max(max_end, cur_max);
  }
  return max_end;
}
int main() {
  long long t;
  cin >> t;
  while (t--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    long long sum = 0, neg = 0;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      if (v[i] <= 0) neg = 1;
      sum += v[i];
    }
    if (neg == 0)
      cout << "YES\n";
    else {
      long long maxi = max(func(v, 1, v.size() - 1), func(v, 0, v.size() - 2));
      if (maxi >= sum)
        cout << "NO\n";
      else
        cout << "YES\n";
    }
  }
  return 0;
}
