#include <bits/stdc++.h>
using namespace std;
long long a[100005];
long long p[100005];
void solve() {
  int N, i, f;
  long long s, y, b;
  scanf("%d\n", &N);
  f = y = s = 0;
  b = -(1LL << 40);
  p[0] = 0;
  for (i = 0; i < N; i++) {
    scanf("%lld\n", &a[i]);
    s += a[i];
    p[i + 1] = p[i] + a[i];
  }
  for (i = 0; i < N; i++) {
    if (s - p[i + 1] >= s) {
      f = 1;
    }
    if (p[i] >= s) {
      f = 1;
    }
  }
  if (!f) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}
int main() {
  int T;
  scanf("%d\n", &T);
  while (T--) {
    solve();
  }
  return 0;
}
