#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  long long a[n];
  long long sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sum += a[i];
  }
  long long mm = 0, mn = INT_MAX;
  long long temp = 0;
  for (int i = 0; i < n; i++) {
    temp += a[i];
    mm = max(mm, temp);
    mn = min(mn, temp);
    if (mm - mn >= sum || (temp >= sum && (i < n - 1))) {
      cout << "NO\n";
      return;
    }
  }
  cout << "YES\n";
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int q = 1;
  cin >> q;
  for (int kase = 1; kase <= q; kase++) {
    solve();
  }
  return 0;
}
