N = int(eval(input()))

AB = [list(map(int, input().split())) for _ in range(N)]



AB.sort(key=lambda ab: ab[1])



cnt = 0

for a, b in AB:

    if cnt + a <= b:

        cnt += a

    else:

        print("No")

        exit()

print("Yes")

import sys, heapq, bisect, math, fractions

from collections import deque



N = int(eval(input()))

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



AB.sort(key=lambda x: x[1])



time = 0

for i in range(N):

    time += AB[i][0]

    if time > AB[i][1]:

        print("No")

        exit()



print("Yes")
N = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda ab: ab[1])
cnt = 0
for a, b in AB:
    if cnt + a <= b:
        cnt += a
    else:
        print("No")
        exit()
print("Yes")

import sys, heapq, bisect, math, fractions
from collections import deque

N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])
time = 0
for i in range(N):
    time += AB[i][0]
    if time > AB[i][1]:
        print("No")
        exit()
print("Yes")

+import sys, heapq, bisect, math, fractions +from collections import deque + -AB = [list(map(int, input().split())) for _ in range(N)] -AB.sort(key=lambda ab: ab[1]) -cnt = 0 -for a, b in AB: -    if cnt + a <= b: -        cnt += a -    else: +AB = [tuple(map(int, input().split())) for _ in range(N)] +AB.sort(key=lambda x: x[1]) +time = 0 +for i in range(N): +    time += AB[i][0] +    if time > AB[i][1]: