#include <bits/stdc++.h>
using namespace std;
void solve() {}
int main() {
  int q;
  cin >> q;
  while (q--) {
    long long n, sum = 0, ans = 1;
    cin >> n;
    vector<long long> pref(n), v(n), suff(n);
    cin >> v[0];
    pref[0] = v[0];
    for (int i = 1; i < n; ++i) {
      cin >> v[i];
      pref[i] = pref[i - 1] + v[i];
    }
    suff[n - 1] = v[n - 1];
    for (int i = n - 2; i >= 0; --i) {
      suff[i] = suff[i + 1] + v[i];
    }
    for (int i = 0; i < n - 1; ++i) {
      if (suff[i] <= 0 || pref[i] <= 0) {
        ans = 0;
      }
    }
    for (int i = n - 1; i >= 1; --i) {
      if (suff[i] <= 0 || pref[i] <= 0) {
        ans = 0;
      }
    }
    if (ans)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
  return 0;
}
