#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int n;
    cin >> n;
    long long int a[n];
    long long int from_s = 0, from_l = 0;
    int flag = 0, i;
    for (int i = 0; i < n; i++) cin >> a[i];
    for (i = 0; i < n; i++) {
      from_s += a[i];
      from_l += a[n - 1 - i];
      if (from_s <= 0 || from_l <= 0) {
        cout << "NO" << endl;
        flag = 1;
        break;
      }
    }
    if (i == n) cout << "YES" << endl;
  }
  return 0;
}
