// Arup Guha
// 3/25/2022
// Solution to Codeforces D2 Round 774 Problem B: Quality vs Quantity
// Used for COP 3503 Exam #2 Question 4
import java.util.*;
import java.io.*;

public class b_alt {

	public static void main(String[] args) throws Exception {
	
		BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
		int nC = Integer.parseInt(stdin.readLine());
		Random rnd = new Random();
		
		// Go through the cases.
		for (int loop=0; loop<nC; loop++) {
		
			// Read input.
			int n = Integer.parseInt(stdin.readLine());
			long[] list = new long[n];
			StringTokenizer tok = new StringTokenizer(stdin.readLine());
			for (int i=0; i<n; i++)
				list[i] = Long.parseLong(tok.nextToken());
			
			// To randomize array before sort.
			for (int i=0; i<3*n; i++) {
				int x = rnd.nextInt(n);
				int y = rnd.nextInt(n);
				long tmp = list[x];
				list[x] = list[y];
				list[y] = tmp;
			}
			
			// Output accordingly.
			if (canSplit(list)) 	
				System.out.println("YES");
			else		
				System.out.println("NO");
		
		}
	}
	
	// Method for exam
	public static boolean canSplit(long[] a) {

		// Sort the array.
		Arrays.sort(a);					// 4 pts

		// Start the left sum with 1 value, the right with none.
		long leftS = a[0], rightS = 0;		// 1 pt
		
		// Here are the next indexes we'll add in.
		int i = 1, j = a.length-1;		// 1 pt

		// No point in crossing over...
		while (i < j) {						// 2 pts
		
			// Add one item from left, one from right, leftS always has 1 more # than rightS.
			leftS += a[i++];					// 2 pts
			rightS += a[j--];				// 2 pts
			
			// We found something that satisfies the query, return true!
			if (leftS < rightS) return true;	// 2 pts
		}

		// If we get here, nothing worked.
		return false;					// 1 pt
	}
}




