#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll gcd(ll a, ll b) { return a % b == 0 ? b : gcd(b, a % b); }
ll lcm(ll x, ll y) {
  ll z = gcd(x, y);
  return x * y / z;
}
int cmp(int x, int y) { return x > y; }
const int MAXX = 1e6 + 5;
ll quick_pow(ll x, ll r) {
  ll sum = 1;
  while (r) {
    if (r & 1) sum = sum * x;
    x *= x;
    r /= 2;
  }
  return sum;
}
int main() {
  ios::sync_with_stdio(false);
  int t, n;
  cin >> t;
  while (t--) {
    cin >> n;
    int j = 0;
    long long a[n + 5], b[n + 5], dp[n + 5], dp2[n + 5], sum = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      sum += a[i];
    }
    for (int i = n - 1; i >= 0; i--) {
      b[j] = a[i];
      j++;
    }
    dp[0] = a[0];
    long long ma = dp[0];
    for (int i = 1; i <= n - 2; i++) {
      dp[i] = max(a[i], dp[i - 1] + a[i]);
      if (dp[i] > ma) ma = dp[i];
    }
    dp2[0] = b[0];
    ma = max(ma, dp2[0]);
    for (int i = 1; i <= n - 2; i++) {
      dp2[i] = max(b[i], dp2[i - 1] + b[i]);
      if (dp2[i] > ma) ma = dp2[i];
    }
    if (ma >= sum)
      cout << "NO\n";
    else
      cout << "YES\n";
  }
  return 0;
}
