#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const int MAXN = 100;
const int MOD = 1000000007;
const double eps = 1e-8;
const double PI = acos(-1.0);
long long a[100005], sum[100005];
int mn[100005];
int main() {
  ios::sync_with_stdio(false);
  int t;
  scanf("%d", &t);
  while (t--) {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) {
      scanf("%lld", &a[i]);
    }
    long long sum = 0, tmp = 0, mx = -0x3f3f3f3f3f3f3f3f;
    int l = 0, r = n, len = INF;
    for (int i = 1; i <= n; i++) {
      sum += a[i];
      if (tmp <= 0) {
        l = i;
        tmp = a[i];
      } else
        tmp += a[i];
      if (tmp > mx) {
        mx = tmp;
        len = i - l + 1;
      }
    }
    if (sum > mx) {
      puts("YES");
    } else {
      if (sum == mx && len == n) {
        puts("YES");
      } else
        puts("NO");
    }
  }
  return 0;
}
