#include <bits/stdc++.h>
using namespace std;
static const size_t npos = -1;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  while (n--) {
    vector<int> v;
    int k;
    cin >> k;
    while (k--) {
      int x;
      cin >> x;
      v.push_back(x);
    }
    long long int y = 0;
    for (int x : v) {
      y += x;
    }
    long long int track = 0;
    bool check = true;
    for (int i = 0; i < v.size() - 1; i++) {
      track += v[i];
      if (track <= 0) {
        check = false;
        break;
      }
    }
    track = 0;
    for (int i = v.size() - 1; i >= 1; i--) {
      track += v[i];
      if (track <= 0) {
        check = false;
        break;
      }
    }
    if (check) {
      cout << "YES"
           << "\n";
    } else {
      cout << "NO"
           << "\n";
    }
  }
}
