#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, i, n, j, k, l;
  cin >> t;
  while (t--) {
    cin >> n;
    int ar[n];
    long long int s = 0, r = 0;
    bool flag = true;
    for (i = 0; i < n; i++) {
      cin >> ar[i];
      s = s + ar[i];
      if (s <= 0) flag = 0;
    }
    s = 0;
    if (flag) {
      for (i = n - 1; i >= 0; i--) {
        s = s + ar[i];
        if (s <= 0) flag = 0;
      }
    }
    if (flag)
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
