#include <bits/stdc++.h>
using namespace std;
long long int n;
std::vector<long long int> a;
bool solve() {
  cin >> n;
  a.resize(n);
  for (auto &i : a) cin >> i;
  long long int sum = 0;
  for (int i = 0; i < n; i++) {
    sum += a[i];
    if (sum <= 0) return 0;
  }
  sum = 0;
  for (int i = n - 1; i >= 0; i--) {
    sum += a[i];
    if (sum <= 0) return 0;
  }
  return 1;
}
int main() {
  long long int t, n;
  cin >> t;
  while (t--) {
    if (solve())
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
