#include <bits/stdc++.h>
using namespace std;
long long a[100005];
int main() {
  int q;
  cin >> q;
  while (q--) {
    int n;
    cin >> n;
    long long sum = 0, best = 0, ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      ans += a[i];
    }
    for (int i = 0; i < n - 1; i++) {
      sum = max(a[i], a[i] + sum);
      best = max(best, sum);
    }
    sum = 0;
    for (int i = 1; i < n; i++) {
      sum = max(a[i], a[i] + sum);
      best = max(best, sum);
    }
    sum = 0;
    for (int i = 1; i < n - 1; i++) {
      sum = max(a[i], a[i] + sum);
      best = max(best, sum);
    }
    if (best >= ans)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
