#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
using pi = pair<long long int, long long int>;
long long int i, j, k;
void solve() {
  long long int n;
  cin >> n;
  vector<long long int> v(n);
  for (i = 0; i < n; i++) cin >> v[i];
  long long int sum = 0;
  for (i = 0; i < n; i++) {
    sum = sum + v[i];
    if (sum <= 0) {
      cout << "NO" << '\n';
      return;
    }
  }
  sum = 0;
  for (i = n - 1; i >= 0; i--) {
    sum = sum + v[i];
    if (sum <= 0) {
      cout << "NO" << '\n';
      return;
    }
  }
  cout << "YES" << '\n';
  return;
}
signed main() {
  int ___T;
  scanf("%d", &___T);
  for (int cs = 1; cs <= ___T; cs++) solve();
  return 0;
}
