#include <bits/stdc++.h>
using namespace std;
long long int a[200007], n, m, sum;
long long int subSum1() {
  long long int max_so_far = m, max_ending_here = 0;
  for (int i = 0; i < n - 1; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
long long int subSum2() {
  long long int max_so_far = m, max_ending_here = 0;
  for (int i = 1; i < n; i++) {
    max_ending_here = max_ending_here + a[i];
    if (max_so_far < max_ending_here) max_so_far = max_ending_here;
    if (max_ending_here < 0) max_ending_here = 0;
  }
  return max_so_far;
}
int main() {
  int t;
  cin >> t;
  while (t--) {
    cin >> n;
    sum = m = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    if (sum < 0) {
      cout << "NO" << endl;
      continue;
    }
    m = sum - 10;
    long long int adel = max(subSum1(), subSum2());
    if (sum > adel)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
}
