#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 5;
long long n, t, tmp;
long long a[maxn], dp[maxn], d[maxn];
int main() {
  cin >> t;
  while (t--) {
    long long sum = 0;
    memset(dp, -0x3f3f3f3f, sizeof(dp));
    memset(d, -0x3f3f3f3f, sizeof(d));
    scanf("%lld", &n);
    for (int i = 1; i <= n; i++) scanf("%lld", &a[i]), sum += a[i];
    dp[1] = a[1];
    long long Max = -0x3f3f3f3f;
    Max = max(Max, dp[1]);
    for (int i = 2; i < n; i++)
      dp[i] = max(dp[i - 1] + a[i], a[i]), Max = max(Max, dp[i]);
    d[2] = a[2];
    Max = max(Max, d[2]);
    for (int i = 3; i <= n; i++)
      d[i] = max(d[i - 1] + a[i], a[i]), Max = max(Max, d[i]);
    if (sum > Max)
      printf("YES\n");
    else
      printf("NO\n");
  }
  return 0;
}
