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