Walter White and Jesse Pinkman (a drug addict) both love to play with chemicals. One day they were playing with some chemicals to make an energy drink. Unknowingly they made a highly powerful drink. To test the drink on others also they called some of their friends and gave a drop of it to everyone. Now they all were feeling highly energetic and thought of an unique game to play with each other.
After pondering for a while, Jesse came up with an extraordinary idea of competing in a race around a circular globe with N checkpoints each of one unit. Walter and all their other friends agreed with it.They divided themselves in $2$ teams with $N$ teammates in each team.This race has two commencing points $A$ and $B$ strictly facing each other. Walter and his team commences from $A$ point and other team starts from $B$. Both the teams start running at the same time clockwise around the globe. Speed of every player is constant throughout the race. If a player has a speed $X$ then it means that he covers a distance of $X$ units in one second.The race ends when some member of one team overtakes all members of opposite team at any point of time. Now you have to tell if any team will win the race or not.They all are stubborn and can run forever just to win the race. Help them to know if it is possible in anyway that the race will come to an end. 
For Clarity, you can visualize the path as a circular paths where $A$ and $B$ are opposite ends of diameter. It can be proven that the actual circumference of circle do not affect the answer.
It is also possible that someone don't run at all.Keep in mind that the fastest one wins the race so does the code.

-----Input:------
- The first line of the input contains a single integer $T$ denoting the number of test cases. The description of $T$ test cases follows. 
- The first line of each test case contains a single integer $N$ number of teammates in both team.
- The second line contains $N$ space-separated integers $A_1, A_2 \ldots A_N$ denoting speed of A's Team
- The third line contains $N$ space-separated integers  $B_1, B_2 \ldots B_N$ denoting speed of B's Team

-----Output:------
For each test case, print a single line denoting YES if the race ends at any point of time else NO

-----Constraints-----
- $1 \leq T \leq 10$
- $1 \leq N \leq 10^5$
- $0 \leq A_i \leq 2^{15}$
- $0 \leq B_i \leq 2^{15}$

-----Subtasks-----
Subtask #1 (30 points): 
- $1 \le N \le 20$
- $0 \le  A_i  \le 11$
- $0 \le  B_i  \le 11$
Subtask #2 (70 points): 
- Original constraints

-----Sample input:-----
1
5
1 2 3 4 5
2 7 8 9 9

-----Sample output-----
YES

-----Sample Explanation:------
Team B can overtake all members of Team A.

Source: codechef | Difficulty: UNKNOWN_DIFFICULTY


Solutions:
l1 = int(input())
for i in range(l1):
	x = int(input())
	y = list(map(int, input().split()))
	z = list(map(int, input().split()))
	if max(z) != max(y):
		print('YES')
	else:
		print('NO')


try:
	for _ in range(int(input())):
		n = int(input())
		a = list(map(int, input().split()))
		b = list(map(int, input().split()))
		(ma, mb) = (max(a), max(b))
		if abs(ma - mb):
			print('YES')
		else:
			print('NO')
except:
	pass


for i in range(int(input())):
	n = int(input())
	a = list(map(int, input().split()))
	b = list(map(int, input().split()))
	if max(a) != max(b):
		print('YES')
	else:
		print('NO')


t = int(input())
while t:
	n = int(input())
	a = [int(x) for x in input().split()]
	b = [int(x) for x in input().split()]
	if max(a) == max(b):
		print('NO')
	else:
		print('YES')
	t -= 1


try:
	for _ in range(int(input())):
		n = int(input())
		l = list(map(int, input().split()))
		ln = list(map(int, input().split()))
		a = max(l)
		b = max(ln)
		if a == b:
			print('NO')
		else:
			print('YES')
except:
	pass


for _ in range(int(input())):
	n = int(input())
	l = list(map(int, input().split()))
	l1 = list(map(int, input().split()))
	a = max(l)
	b = max(l1)
	if a == b:
		print('NO')
	else:
		print('YES')


T = int(input())
for i in range(T):
	(N, dataA, dataB) = (int(input()), list(map(int, input().split())), list(map(int, input().split())))
	if max(dataA) != max(dataB):
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	l1 = list(map(int, input().split()))
	l1.sort()
	l2 = list(map(int, input().split()))
	l2.sort()
	if l1[n - 1] != l2[n - 1]:
		print('YES')
	else:
		print('NO')


T = int(input())
while T > 0:
	T -= 1
	n = int(input())
	listA = list(map(int, input().split()))
	listB = list(map(int, input().split()))
	maxA = max(listA)
	maxB = max(listB)
	if maxB > maxA or maxA > maxB:
		print('YES')
	else:
		print('NO')


for _ in range(int(input())):
	n = int(input())
	x = list(map(int, input().split()))
	y = list(map(int, input().split()))
	if max(x) == max(y):
		print('NO')
	else:
		print('YES')


try:
	t1 = int(input())
	for _ in range(t1):
		n = int(input())
		l1 = list(map(int, input().split()))
		l2 = list(map(int, input().split()))
		if max(l1) != max(l2):
			print('YES')
		else:
			print('NO')
except:
	pass


J = int(input())
for i in range(J):
	x = int(input())
	A = [int(x) for x in input().split()]
	B = [int(x) for x in input().split()]
	if max(A) > max(B) or max(B) > max(A):
		print('YES')
	else:
		print('NO')


t = int(input())
for _ in range(t):
	n = int(input())
	a = [int(x) for x in input().split(' ')]
	b = [int(x) for x in input().split(' ')]
	if max(a) != max(b):
		print('YES')
	else:
		print('NO')


for __ in range(int(input())):
	n = int(input())
	w = [int(x) for x in input().split()]
	j = [int(x) for x in input().split()]
	if max(w) == max(j):
		print('NO')
	else:
		print('YES')


import heapq as hp
from sys import stdin
testCases = int(input())
result = []
while testCases:
	try:
		number = int(input())
		team_A = [int(x) for x in input().split()]
		team_B = [int(x) for x in input().split()]
		if max(team_A) != max(team_B):
			result.append('YES')
		else:
			result.append('NO')
		testCases = -1
	except:
		break
for i in result:
	print(i)


try:
	t = int(input())
	for _ in range(t):
		n = int(input())
		a = [int(i) for i in input().split()]
		b = [int(i) for i in input().split()]
		if max(a) != max(b):
			print('YES')
		else:
			print('NO')
except EOFError as e:
	pass