n=int(eval(input()))

task=[] 

for _ in range(n):

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

    task.append((b, -a))



task.sort()



time=0

flag=True

for i in task:

    time-=i[1]

    if time>i[0]:

        flag=False

        break



if flag:

    print("Yes")

else:

    print("No")



import sys

from collections import defaultdict

from operator import itemgetter

input = sys.stdin.readline



N = int(eval(input()))

d = defaultdict(int)

for _ in range(N):

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

    d[b] += a

task = list(d.items())

task.sort()



now = 0

ans = "Yes"

for limit, time in task:

    now += time

    if now > limit:

        ans = "No"

        break



print(ans)

n = int(eval(input()))
task = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    task.append((b, -a))
task.sort()
time = 0
flag = True
for i in task:
    time -= i[1]
    if time > i[0]:
        flag = False
        break
if flag:
    print("Yes")
else:
    print("No")

import sys
from collections import defaultdict
from operator import itemgetter

input = sys.stdin.readline
N = int(eval(input()))
d = defaultdict(int)
for _ in range(N):
    a, b = list(map(int, input().split()))
    d[b] += a
task = list(d.items())
task.sort()
now = 0
ans = "Yes"
for limit, time in task:
    now += time
    if now > limit:
        ans = "No"
        break
print(ans)

-n = int(eval(input())) -task = [] -for _ in range(n): +import sys +from collections import defaultdict +from operator import itemgetter + +input = sys.stdin.readline +N = int(eval(input())) +d = defaultdict(int) +for _ in range(N): -    task.append((b, -a)) +    d[b] += a +task = list(d.items()) -time = 0 -flag = True -for i in task: -    time -= i[1] -    if time > i[0]: -        flag = False +now = 0 +ans = "Yes" +for limit, time in task: +    now += time +    if now > limit: +        ans = "No" -if flag: -    print("Yes") -else: -    print("No") +print(ans)