#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
long long dp[maxn];
long long a[maxn];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int T;
  cin >> T;
  while (T--) {
    int n;
    cin >> n;
    long long ans = 0;
    for (int i = 0; i < n; i++) {
      cin >> a[i];
      ans += a[i];
    }
    long long res = a[0];
    dp[0] = a[0];
    for (int i = 1; i < n - 1; i++) {
      dp[i] = max(dp[i - 1] + a[i], a[i]);
      res = max(res, dp[i]);
    }
    res = max(res, a[1]);
    dp[1] = a[1];
    for (int i = 2; i < n; i++) {
      dp[i] = max(dp[i - 1] + a[i], a[i]);
      res = max(res, dp[i]);
    }
    if (res < ans)
      cout << "YES";
    else
      cout << "NO";
    cout << endl;
  }
  return 0;
}
