#include <bits/stdc++.h>
using namespace std;
long long a[100010];
long long s[100010];
int main() {
  int T;
  cin >> T;
  while (T--) {
    long long ans = 0, minn = 0;
    int n;
    scanf("%d", &n);
    long long summ = 0;
    for (register int i = 1; i <= n; i++) scanf("%lld", &a[i]), summ += a[i];
    minn = min((long long)0, a[2]);
    s[2] = a[2];
    ans = a[2];
    for (register int i = 3; i <= n - 1; i++) {
      s[i] = s[i - 1] + a[i];
      if (s[i] - minn > ans) ans = s[i] - minn;
      if (s[i] < minn) minn = s[i];
    }
    long long now = 0;
    for (register int i = 1; i <= n - 1; i++) {
      now += a[i];
      if (now > ans) ans = now;
    }
    now = 0;
    for (register int i = n; i >= 2; i--) {
      now += a[i];
      if (now > ans) ans = now;
    }
    if (ans >= summ)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
