#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    vector<int> v(n);
    long long int temp = 0;
    bool y = false;
    for (int i = 0; i < n; ++i) cin >> v[i];
    for (int i = 0; i < n; ++i) {
      temp += v[i];
      if (temp <= 0) {
        y = true;
        break;
      }
    }
    if (y) goto r;
    temp = 0;
    for (int i = n - 1; i >= 0; --i) {
      temp += v[i];
      if (temp <= 0) {
        y = true;
        break;
      }
    }
  r:;
    if (y)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
}
