from operator import itemgetter

N = int(eval(input()))



A = []

for i in range(N):

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

  

A.sort(key=itemgetter(1))



now = 0

for a in A:

  now += a[0]

  if now > a[1]:

    print('No')

    exit(0)

    

print('Yes')
from operator import itemgetter

N = int(eval(input()))



A = [[0] * 2 for i in range(N)]

for i in range(N):

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

  

A.sort(key=itemgetter(1))



now = 0

for a in A:

  now += a[0]

  if now > a[1]:

    print('No')

    exit(0)

    

print('Yes')
from operator import itemgetter

N = int(eval(input()))
A = []
for i in range(N):
    A.append(list(map(int, input().split())))
A.sort(key=itemgetter(1))
now = 0
for a in A:
    now += a[0]
    if now > a[1]:
        print("No")
        exit(0)
print("Yes")

from operator import itemgetter

N = int(eval(input()))
A = [[0] * 2 for i in range(N)]
for i in range(N):
    A[i] = list(map(int, input().split()))
A.sort(key=itemgetter(1))
now = 0
for a in A:
    now += a[0]
    if now > a[1]:
        print("No")
        exit(0)
print("Yes")

-A = [] +A = [[0] * 2 for i in range(N)] -    A.append(list(map(int, input().split()))) +    A[i] = list(map(int, input().split()))