#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long T = 1;
  cin >> T;
  while (T--) {
    long long n;
    cin >> n;
    vector<long long> v(n);
    long long ans = 0;
    for (long long i = 0; i < n; i++) {
      cin >> v[i];
      ans += v[i];
    }
    long long max_so_far = INT_MIN, max_ending_here = 0, c = 0, s = 0;
    for (long long i = 0; i < n - 1; i++) {
      max_ending_here = max_ending_here + v[i];
      if (max_so_far < max_ending_here) max_so_far = max_ending_here, s = c + 1;
      if (max_so_far == max_ending_here) s = min(s, c + 1);
      if (max_ending_here <= 0)
        max_ending_here = 0, c = 0;
      else
        c++;
    }
    long long temp = max_so_far;
    max_so_far = INT_MIN, max_ending_here = 0;
    for (long long i = 1; i < n; i++) {
      max_ending_here = max_ending_here + v[i];
      if (max_so_far < max_ending_here) max_so_far = max_ending_here, s = c + 1;
      if (max_so_far == max_ending_here) s = min(s, c + 1);
      if (max_ending_here <= 0)
        max_ending_here = 0, c = 0;
      else
        c++;
    }
    temp = max(temp, max_so_far);
    if (temp >= ans)
      cout << "NO" << endl;
    else
      cout << "YES" << endl;
  }
  return 0;
}
