#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  int t;
  cin >> t;
  while (t--) {
    int n, total = 0;
    vector<int> a;
    a.emplace_back(0);
    cin >> n;
    for (int i = 0, temp; i < n; i++) {
      cin >> temp;
      a.emplace_back(temp);
      total += temp;
    }
    for (int i = 1; i <= n; i++) a[i] += a[i - 1];
    int l = 0, mx = -INT_MAX;
    for (int i = 1; i < n; i++) {
      mx = max(mx, a[i] - a[l]);
      if (a[i] < a[l]) l = i;
    }
    l = 1;
    for (int i = 2; i <= n; i++) {
      mx = max(mx, a[i] - a[l]);
      if (a[i] < a[l]) l = i;
    }
    if (total > mx)
      cout << "YES" << endl;
    else
      cout << "NO" << endl;
  }
  return 0;
}
