#include <bits/stdc++.h>
using namespace std;
int t, n, x;
int main() {
  cin >> t;
  for (int k = 1; k <= t; ++k) {
    cin >> n;
    int sumy = 0, suma = 0, dem = 0, tmp = 0, tmpdem = 0;
    for (int i = 1; i <= n; ++i) {
      cin >> x;
      sumy += x;
      suma += x;
      ++dem;
      if (suma < 0) {
        suma = 0;
        dem = 0;
      }
      if (suma > tmp) {
        tmp = suma;
        tmpdem = dem;
      }
    }
    if (tmp >= sumy && tmpdem != n) {
      cout << "NO" << endl;
    } else
      cout << "YES" << endl;
  }
  return 0;
}
