#include <bits/stdc++.h>
using namespace std;
bool solve() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (auto &i : a) cin >> i;
  long long 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() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int T;
  cin >> T;
  while (T--) {
    if (solve())
      cout << "YES\n";
    else
      cout << "NO\n";
  }
}
