n=int(eval(input()))

l=list()

for i in range(n):

    l.append(list(map(int,input().split())))

l.sort(key=lambda x:x[1])

t=0#time

p=True

for i,j in l:

    t+=i

    if t>j:

        p=False

        print('No')

        break

if p:

    print('Yes')
n,*pl=list(map(int,open(0).read().split()))

l=[[pl[i],pl[i+1]] for i in range(0,n*2,2)]

l.sort(key=lambda x:x[1])

t=0#time

p=True

for i,j in l:

    t+=i

    if t>j:

        p=False

        print('No')

        break

if p:

    print('Yes')
n = int(eval(input()))
l = list()
for i in range(n):
    l.append(list(map(int, input().split())))
l.sort(key=lambda x: x[1])
t = 0  # time
p = True
for i, j in l:
    t += i
    if t > j:
        p = False
        print("No")
        break
if p:
    print("Yes")

n, *pl = list(map(int, open(0).read().split()))
l = [[pl[i], pl[i + 1]] for i in range(0, n * 2, 2)]
l.sort(key=lambda x: x[1])
t = 0  # time
p = True
for i, j in l:
    t += i
    if t > j:
        p = False
        print("No")
        break
if p:
    print("Yes")

-n = int(eval(input())) -l = list() -for i in range(n): -    l.append(list(map(int, input().split()))) +n, *pl = list(map(int, open(0).read().split())) +l = [[pl[i], pl[i + 1]] for i in range(0, n * 2, 2)]