import numpy as np

# 締切が早いものから処理

N = int(eval(input()))

AB = np.array([[int(x) for x in input().split()] for _ in range(N)])

A = AB[:,0]

B = AB[:,1]

idx = B.argsort()

A = A[idx]

B = B[idx]

np.cumsum(A, out = A)

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

answer = 'Yes' if bl else 'No'

print(answer)
import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



# 締切の近いものから詰め込む



import numpy as np



N = int(readline())

AB = np.array(read().split(),np.int64)



A = AB[::2]; B = AB[1::2]



ind = B.argsort(); A = A[ind]; B = B[ind]



answer = 'Yes' if np.all(A.cumsum() <= B) else 'No'

print(answer)
import numpy as np

# 締切が早いものから処理
N = int(eval(input()))
AB = np.array([[int(x) for x in input().split()] for _ in range(N)])
A = AB[:, 0]
B = AB[:, 1]
idx = B.argsort()
A = A[idx]
B = B[idx]
np.cumsum(A, out=A)
bl = (A <= B).all()
answer = "Yes" if bl else "No"
print(answer)

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
# 締切の近いものから詰め込む
import numpy as np

N = int(readline())
AB = np.array(read().split(), np.int64)
A = AB[::2]
B = AB[1::2]
ind = B.argsort()
A = A[ind]
B = B[ind]
answer = "Yes" if np.all(A.cumsum() <= B) else "No"
print(answer)

+import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines +# 締切の近いものから詰め込む -# 締切が早いものから処理 -N = int(eval(input())) -AB = np.array([[int(x) for x in input().split()] for _ in range(N)]) -A = AB[:, 0] -B = AB[:, 1] -idx = B.argsort() -A = A[idx] -B = B[idx] -np.cumsum(A, out=A) -bl = (A <= B).all() -answer = "Yes" if bl else "No" +N = int(readline()) +AB = np.array(read().split(), np.int64) +A = AB[::2] +B = AB[1::2] +ind = B.argsort() +A = A[ind] +B = B[ind] +answer = "Yes" if np.all(A.cumsum() <= B) else "No"