from operator import itemgetter

N = int(eval(input()))

A = [None] * N

for i in range(N):

  A[i] = list(map(int,input().split()))



s = sorted(A, key=itemgetter(0),reverse=True)

t = sorted(s, key=itemgetter(1))



time = 0

for i in range(N):

  if t[i][0] + time <= t[i][1]:

    time += t[i][0]

  else:

    print('No')

    exit()

print('Yes')
from operator import itemgetter

N = int(eval(input()))

A = [None] * N

for i in range(N):

  A[i] = list(map(int,input().split()))



#s = sorted(A, key=itemgetter(0),reverse=True)

t = sorted(A, key=itemgetter(1))



time = 0

for i in range(N):

  if t[i][0] + time <= t[i][1]:

    time += t[i][0]

  else:

    print('No')

    exit()

print('Yes')
from operator import itemgetter

N = int(eval(input()))
A = [None] * N
for i in range(N):
    A[i] = list(map(int, input().split()))
s = sorted(A, key=itemgetter(0), reverse=True)
t = sorted(s, key=itemgetter(1))
time = 0
for i in range(N):
    if t[i][0] + time <= t[i][1]:
        time += t[i][0]
    else:
        print("No")
        exit()
print("Yes")

from operator import itemgetter

N = int(eval(input()))
A = [None] * N
for i in range(N):
    A[i] = list(map(int, input().split()))
# s = sorted(A, key=itemgetter(0),reverse=True)
t = sorted(A, key=itemgetter(1))
time = 0
for i in range(N):
    if t[i][0] + time <= t[i][1]:
        time += t[i][0]
    else:
        print("No")
        exit()
print("Yes")

-s = sorted(A, key=itemgetter(0), reverse=True) -t = sorted(s, key=itemgetter(1)) +# s = sorted(A, key=itemgetter(0),reverse=True) +t = sorted(A, key=itemgetter(1))