#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long SIZE = 100000;
const int INF = 0x3f3f3f3f;
const long long ll_INF = 0x3f3f3f3f3f3f3f3f;
const long double PI = acos(-1);
const long long MAXN = numeric_limits<long long>::max();
const long long MAX = 2000000;
long long vis[100001];
long long col[100001];
vector<long long> cnt[2];
vector<long long> adj[100001];
bool dfs_check_bipartite(long long u, long long c) {
  vis[u] = 1;
  col[u] = c;
  cnt[c].push_back(u);
  for (auto x : adj[u]) {
    if (vis[x] == 0) {
      if (dfs_check_bipartite(x, c ^ 1) == false) return false;
    } else if (col[u] == col[x]) {
      return false;
    }
  }
  return true;
}
void dfs(long long u) {
  vis[u] = 1;
  for (auto x : adj[u]) {
    if (vis[u] == 0) dfs(x);
  }
}
void showq(queue<long long> gq) {
  queue<long long> g = gq;
  while (!g.empty()) {
    cout << g.front() << " ";
    g.pop();
  }
}
bool isprime(int n) {
  if (n <= 1) return false;
  for (int i = 2; i < n; i++)
    if (n % i == 0) return false;
  return true;
}
long long spf[MAX];
void spf_sieve() {
  spf[1] = 1;
  for (long long i = 2; i < MAX; i++) spf[i] = i;
  for (long long i = 4; i < MAX; i += 2) spf[i] = 2;
  for (long long i = 3; i * i < MAX; i++) {
    if (spf[i] == i) {
      for (int j = i * i; j < MAX; j += i)
        if (spf[j] == j) spf[j] = i;
    }
  }
}
vector<long long> PrimeFactors(long long x) {
  vector<long long> ret;
  while (x != 1) {
    ret.push_back(spf[x]);
    x = x / spf[x];
  }
  return ret;
}
void solve() {
  long long n;
  cin >> n;
  long long arr[n];
  for (long long i = 0; i < n; i++) cin >> arr[i];
  long long s1 = 0, s2 = 0;
  for (long long i = 0; i < n; i++) {
    s1 += arr[i];
    if (s1 <= 0) {
      cout << "NO" << endl;
      return;
    }
    s2 += arr[n - i - 1];
    if (s2 <= 0) {
      cout << "NO" << endl;
      return;
    }
  }
  cout << "YES" << endl;
}
int main() {
  std::ios::sync_with_stdio(false);
  int t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
