n = int(eval(input()))

lis = sorted([list(map(int,input().split())) for _ in range(n)], key = lambda z:z[1])

t = 0

ans = "Yes"

for i in lis:

    t += i[0]

    if t > i[1]:

        ans = "No"

print(ans)
from operator import itemgetter

n = int(eval(input()))

lis =sorted([list(map(int,input().split())) for _ in range(n)], key = itemgetter(1))

t = 0

ans = "Yes"

for i in lis:

    t += i[0]

    if t > i[1]:

        ans = "No"

print(ans)
n = int(eval(input()))
lis = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda z: z[1])
t = 0
ans = "Yes"
for i in lis:
    t += i[0]
    if t > i[1]:
        ans = "No"
print(ans)

from operator import itemgetter

n = int(eval(input()))
lis = sorted([list(map(int, input().split())) for _ in range(n)], key=itemgetter(1))
t = 0
ans = "Yes"
for i in lis:
    t += i[0]
    if t > i[1]:
        ans = "No"
print(ans)

+from operator import itemgetter + -lis = sorted([list(map(int, input().split())) for _ in range(n)], key=lambda z: z[1]) +lis = sorted([list(map(int, input().split())) for _ in range(n)], key=itemgetter(1))