#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
inline int read() {
  int a = 0, b = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') b = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    a = (a << 3) + (a << 1) + c - '0';
    c = getchar();
  }
  return a * b;
}
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 7;
int a[N];
long long sum[N];
int main() {
  int T = read();
  while (T--) {
    memset(sum, 0, sizeof(sum));
    int n = read();
    for (register int i = (1); i <= (n); i++)
      a[i] = read(), sum[i] = sum[i - 1] + a[i];
    int flag = 0;
    for (register int i = (1); i <= (n - 1); i++) {
      if (sum[i] <= 0) flag = 1;
      if (sum[n] - sum[i] <= 0) flag = 1;
    }
    if (flag)
      printf("NO\n");
    else
      printf("YES\n");
  }
  return 0;
}
