N = int(eval(input()))

job = []

sum = 0

result = "Yes"

for _ in range(N):

    cost, limit = list(map(int, input().split()))

    job.append((limit,cost))



job.sort()

for i,j in job:

    sum += j

    if i < sum:

        result = "No"

        break



print(result)

from operator import itemgetter

n = int(eval(input()))

jobs = [tuple(map(int, input().split())) for _ in range(n)]

jobs = sorted(jobs, key=itemgetter(1))

total = 0

for a, b in jobs:

    total += a

    if total > b:

        print('No')

        exit()

print('Yes')

N = int(eval(input()))
job = []
sum = 0
result = "Yes"
for _ in range(N):
    cost, limit = list(map(int, input().split()))
    job.append((limit, cost))
job.sort()
for i, j in job:
    sum += j
    if i < sum:
        result = "No"
        break
print(result)

from operator import itemgetter

n = int(eval(input()))
jobs = [tuple(map(int, input().split())) for _ in range(n)]
jobs = sorted(jobs, key=itemgetter(1))
total = 0
for a, b in jobs:
    total += a
    if total > b:
        print("No")
        exit()
print("Yes")

-N = int(eval(input())) -job = [] -sum = 0 -result = "Yes" -for _ in range(N): -    cost, limit = list(map(int, input().split())) -    job.append((limit, cost)) -job.sort() -for i, j in job: -    sum += j -    if i < sum: -        result = "No" -        break -print(result) +from operator import itemgetter + +n = int(eval(input())) +jobs = [tuple(map(int, input().split())) for _ in range(n)] +jobs = sorted(jobs, key=itemgetter(1)) +total = 0 +for a, b in jobs: +    total += a +    if total > b: +        print("No") +        exit() +print("Yes")