#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 29;
long long a[maxn];
int main() {
  int t;
  cin >> t;
  while (t--) {
    long long sum = 0;
    int n;
    bool b = 1;
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) {
      sum += a[i];
      if (sum <= 0) {
        b = 0;
      }
    }
    sum = 0;
    for (int i = n; i >= 1; i--) {
      sum += a[i];
      if (sum <= 0) {
        b = 0;
      }
    }
    if (b == 1) {
      cout << "YES" << endl;
    } else {
      cout << "NO" << endl;
    }
  }
}
