#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
long long kadanes(vector<long long> &v) {
  long long max_so_far1 = LONG_MIN, max_so_far2 = LONG_MIN, max_ending_here = 0;
  for (int i = 0; i < v.size() - 1; i++) {
    max_ending_here += v[i];
    if (max_so_far1 < max_ending_here) max_so_far1 = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  max_ending_here = 0;
  for (int i = 1; i < v.size(); i++) {
    max_ending_here += v[i];
    if (max_so_far2 < max_ending_here) max_so_far2 = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max(max_so_far1, max_so_far2);
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long n, sum = 0;
    cin >> n;
    vector<long long> v(n);
    for (long long &x : v) {
      cin >> x;
      sum += x;
    }
    long long ret = kadanes(v);
    if (sum > ret)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
