#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  long long sum_y = 0, yes = 1, arr[n], sum = 0;
  for (int i = 0; i < n; ++i) {
    cin >> arr[i];
    sum_y += arr[i];
    if (sum_y <= 0) yes = 0;
  }
  reverse(arr, arr + n);
  for (int i = 0; i < n; ++i) {
    sum += arr[i];
    if (sum <= 0) yes = 0;
  }
  if (yes)
    cout << "YES\n";
  else
    cout << "NO\n";
}
int main() {
  int t;
  cin >> t;
  while (t--) solve();
  return 0;
}
