n=int(eval(input()))

l=[]

for i in range(n):

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

    l.append(a)

l=sorted(l,key=lambda x:x[1],reverse=True)



cnt=l[0][1]

for i in range(n):

    if cnt>l[i][1]:

        cnt=l[i][1]

    cnt-=l[i][0]

if cnt>=0:

    print("Yes")

else:

    print("No")
import numpy as np



N = int(eval(input()))

lst=[]

for i in range(N):

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

AB=np.array(lst).reshape(N,2).T

A = AB[0]

B = AB[1]

ind = B.argsort()

A = A[ind]

B = B[ind]

if np.all(A.cumsum() <= B):

    print("Yes")

else:

    print("No")
n = int(eval(input()))
l = []
for i in range(n):
    a = list(map(int, input().split()))
    l.append(a)
l = sorted(l, key=lambda x: x[1], reverse=True)
cnt = l[0][1]
for i in range(n):
    if cnt > l[i][1]:
        cnt = l[i][1]
    cnt -= l[i][0]
if cnt >= 0:
    print("Yes")
else:
    print("No")

import numpy as np

N = int(eval(input()))
lst = []
for i in range(N):
    lst.append(list(map(int, input().split())))
AB = np.array(lst).reshape(N, 2).T
A = AB[0]
B = AB[1]
ind = B.argsort()
A = A[ind]
B = B[ind]
if np.all(A.cumsum() <= B):
    print("Yes")
else:
    print("No")

-n = int(eval(input())) -l = [] -for i in range(n): -    a = list(map(int, input().split())) -    l.append(a) -l = sorted(l, key=lambda x: x[1], reverse=True) -cnt = l[0][1] -for i in range(n): -    if cnt > l[i][1]: -        cnt = l[i][1] -    cnt -= l[i][0] -if cnt >= 0: +import numpy as np + +N = int(eval(input())) +lst = [] +for i in range(N): +    lst.append(list(map(int, input().split()))) +AB = np.array(lst).reshape(N, 2).T +A = AB[0] +B = AB[1] +ind = B.argsort() +A = A[ind] +B = B[ind] +if np.all(A.cumsum() <= B):