from sys import stdin from tkinter import N import heapq def inputSynario(): input = stdin.readline num_list = [] T = int(input().rstrip()) for i in range(T * 2): num_list.append(list(map(int, input().rstrip().split()))) return num_list synario = inputSynario() for synarioId in range(len(synario)//2): N=synario[synarioId * 2] A=synario[synarioId * 2 + 1] isLoopFlag=True while(isLoopFlag): dango=heapq.nlargest(3,A) if(dango[0]==0): print("yes") isLoopFlag=False break for i in range(3): if(dango[i] != 0): index = A.index(dango[i]) A[index] -= 1 else: print("no") isLoopFlag=False break