#include <bits/stdc++.h>
using namespace std;
int power(int x, unsigned int y, int p) {
  int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long int t, i, j, x = 0, n;
  cin >> t;
  for (i = 0; i < t; i++) {
    cin >> n;
    long long int a[n];
    x = 0;
    for (j = 0; j < n; j++) {
      cin >> a[j];
      x = x + a[j];
    }
    long long int sum = 0, best = 0;
    for (j = 0; j < n - 1; j++) {
      sum = max(sum + a[j], a[j]);
      best = max(best, sum);
    }
    sum = 0;
    for (j = 1; j < n; j++) {
      sum = max(sum + a[j], a[j]);
      best = max(best, sum);
    }
    if (x > best) {
      cout << "YES\n";
    } else {
      cout << "NO\n";
    }
  }
}
