#include <bits/stdc++.h>
using namespace std;
void cheack() {
  int n;
  cin >> n;
  long long arr[n];
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
  }
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    sum += arr[i];
    if (sum <= 0) {
      cout << "NO" << endl;
      return;
    }
  }
  sum = 0;
  for (int i = n - 1; i >= 0; i--) {
    sum += arr[i];
    if (sum <= 0) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  int t;
  cin >> t;
  while (t-- > 0) {
    cheack();
  }
}
