n = eval(input())

l = []

for i in range(n):

	a, b = list(map(int, input().split()))

	l.append((b, -a))

curtime = 0

l.sort()

for i in l:

	if curtime - i[1] > i[0]:

		print("No")

		exit(0)

	else:

		curtime -= i[1]

print("Yes")
n = eval(input())

l = []

for i in range(n):

	a, b = list(map(int, input().split()))

	l.append((b, a))

curtime = 0

l.sort()

for i in l:

	if curtime + i[1] > i[0]:

		print("No")

		exit(0)

	else:

		curtime += i[1]

print("Yes")
n = eval(input())
l = []
for i in range(n):
    a, b = list(map(int, input().split()))
    l.append((b, -a))
curtime = 0
l.sort()
for i in l:
    if curtime - i[1] > i[0]:
        print("No")
        exit(0)
    else:
        curtime -= i[1]
print("Yes")

n = eval(input())
l = []
for i in range(n):
    a, b = list(map(int, input().split()))
    l.append((b, a))
curtime = 0
l.sort()
for i in l:
    if curtime + i[1] > i[0]:
        print("No")
        exit(0)
    else:
        curtime += i[1]
print("Yes")

-    l.append((b, -a)) +    l.append((b, a)) -    if curtime - i[1] > i[0]: +    if curtime + i[1] > i[0]: -        curtime -= i[1] +        curtime += i[1]