#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int n, a[100005], sum = 0, f = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      if (a[i] < 0) f = 1;
      sum += a[i];
    }
    long long int si = 0, x = -1, y = -1;
    long long int c = 0, s = -100;
    for (int i = 0; i < n; i++) {
      c += a[i];
      if (c > s) {
        s = c;
        y = i;
        x = si;
      }
      if (c <= 0) {
        si = i + 1;
        c = 0;
      }
    }
    if (x == 0 && y == n - 1) {
      cout << "YES\n";
    } else {
      if (sum > s)
        cout << "YES\n";
      else
        cout << "NO\n";
    }
  }
}
