#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 7;
const int INF = 1e8;
void boost() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(NULL);
}
long long n, a[N], b[N], sum, sum2, ans, dp[N], t;
string s;
int main() {
  boost();
  cin >> t;
  for (int l = 1; l <= t; ++l) {
    cin >> n;
    sum = 0;
    ans = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> a[i];
    }
    for (int i = 1; i <= n; ++i) {
      sum += a[i];
      if (sum <= 0) {
        cout << "NO" << '\n';
        ans = 1;
        break;
      }
    }
    sum = 0;
    for (int i = n; i >= 1; --i) {
      sum += a[i];
      if (sum <= 0 && ans == 0) {
        cout << "NO" << '\n';
        ans = 1;
        break;
      }
    }
    if (!ans) {
      cout << "YES" << '\n';
    }
  }
}
