#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  for (int i = 0; i < t; i++) {
    long long int ans = 0, n, k, count = 0, sum = 0, a, b, tmp = 0, flag = 0,
                  ans1 = 0, tmp1 = 0, m;
    cin >> n;
    long long int arr[n];
    for (int j = 0; j < n; j++) {
      cin >> arr[j];
      sum += arr[j];
    }
    long long int max_so_far = LLONG_MIN, max_end_here = 0;
    for (int j = 0; j < n - 1; j++) {
      max_end_here += arr[j];
      if (max_so_far < max_end_here) {
        max_so_far = max_end_here;
      }
      if (max_end_here < 0) {
        max_end_here = 0;
      }
    }
    max_end_here = 0;
    for (int j = n - 1; j > 0; j--) {
      max_end_here += arr[j];
      if (max_so_far < max_end_here) {
        max_so_far = max_end_here;
      }
      if (max_end_here < 0) {
        max_end_here = 0;
      }
    }
    if (max_so_far < sum) {
      cout << "YES";
    } else {
      cout << "NO";
    }
    cout << "\n";
  }
}
