#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long a, b, c, d, i, j, k, l, m, n, x, y, z, ans = 0, sum = 0;
  bool ok = true;
  cin >> n;
  long long ar[n], pre[n], suf[n];
  for (i = 0; i < n; i++) {
    cin >> ar[i];
    if (i > 0)
      pre[i] = ar[i] + pre[i - 1];
    else
      pre[i] = ar[i];
    if (pre[i] <= 0) ok = false;
  }
  if (!ok) {
    cout << "NO";
    return;
  }
  for (i = n - 1; i >= 0; i--) {
    if (i == n - 1)
      suf[i] = ar[i];
    else
      suf[i] = ar[i] + suf[i + 1];
    if (suf[i] <= 0) {
      ok = false;
      break;
    }
  }
  if (!ok) {
    cout << "NO";
    return;
  }
  if (ok) cout << "YES";
  return;
}
int main() {
  ios::sync_with_stdio(0);
  ;
  int t;
  cin >> t;
  while (t--) {
    solve();
    cout << '\n';
  }
  return 0;
}
