import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

AB = [lr() for _ in range(N)]

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

answer = 'Yes'

time = 0

for i in range(N):

    if time + AB[i][0] > AB[i][1]:

        answer = 'No'

    time += AB[i][0]



print(answer)

import sys

import numpy as np



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

AB = np.array([lr() for _ in range(N)])

AB = AB[np.argsort(AB[:, 1])]

A = AB[:, 0]

B = AB[:, 1]

bl = np.all(A.cumsum() <= B)

print(('Yes' if bl else 'No'))

# 
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
AB = [lr() for _ in range(N)]
AB.sort(key=lambda x: x[1])
answer = "Yes"
time = 0
for i in range(N):
    if time + AB[i][0] > AB[i][1]:
        answer = "No"
    time += AB[i][0]
print(answer)

import sys
import numpy as np

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
AB = np.array([lr() for _ in range(N)])
AB = AB[np.argsort(AB[:, 1])]
A = AB[:, 0]
B = AB[:, 1]
bl = np.all(A.cumsum() <= B)
print(("Yes" if bl else "No"))
#

+import numpy as np -AB = [lr() for _ in range(N)] -AB.sort(key=lambda x: x[1]) -answer = "Yes" -time = 0 -for i in range(N): -    if time + AB[i][0] > AB[i][1]: -        answer = "No" -    time += AB[i][0] -print(answer) +AB = np.array([lr() for _ in range(N)]) +AB = AB[np.argsort(AB[:, 1])] +A = AB[:, 0] +B = AB[:, 1] +bl = np.all(A.cumsum() <= B) +print(("Yes" if bl else "No")) +#