import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Task3 {
    public static void main(String[] args) {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        try {
            StringTokenizer st = new StringTokenizer(br.readLine());
            int T = Integer.parseInt(st.nextToken());
            int[][] a = new int[T][];
            for (int i = 0; i < T; i++) {
                st = new StringTokenizer(br.readLine());
                a[i] = new int[Integer.parseInt(st.nextToken())];
                st = new StringTokenizer(br.readLine());
                for (int j = 0; j < a[i].length; j++) {
                    a[i][j] = Integer.parseInt(st.nextToken());
                }
            }
//            Arrays.stream(a).forEach(arr -> System.out.println(Arrays.toString(arr)));
            for(int[] arr : a) {
                if(arr.length == 4) {
                    Arrays.sort(arr);
                    int temp = arr[0];
                    arr[0] = arr[2];
                    arr[2] = temp;
                    Arrays.sort(arr, 1, 3);
                    if(check(arr)) {
                        System.out.println("YES");
                    } else {
                        System.out.println("NO");
                    }
                } else {
                    System.out.println("NO");
                }
            }
        } catch (IOException ex) {}


    }

    private static boolean check(int[] arr) {
        for(int i = 1; i < arr.length - 1; i++) {
            if(arr[i-1] + arr[i+1] < arr[i] * 2)
                return false;
        }
        return true;
    }
}

/*
1
4
3 1 4 6

 */