N = int(eval(input()))



lst = []

for _ in range(N):

    A, B = list(map(int, input().split()))

    lst += [[B, A]]



lst.sort()

t = 0

for i in range(N):

    t += lst[i][1] #仕事に使う時間をプラス

    if t > lst[i][0]: #制限時間と比較

        print ('No')

        exit()



print ('Yes')

import sys

input = sys.stdin.readline

sys.setrecursionlimit(10 ** 9)

MOD = 10 ** 9 + 7



N = int(eval(input()))

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

AB.sort(key = lambda x: x[1]) #締め切りが早い順位ソート



tmp = 0

for a, b in AB:

    if tmp + a <= b:

        tmp += a

    else:

        print ('No')

        exit()



print ('Yes')
N = int(eval(input()))
lst = []
for _ in range(N):
    A, B = list(map(int, input().split()))
    lst += [[B, A]]
lst.sort()
t = 0
for i in range(N):
    t += lst[i][1]  # 仕事に使う時間をプラス
    if t > lst[i][0]:  # 制限時間と比較
        print("No")
        exit()
print("Yes")

import sys

input = sys.stdin.readline
sys.setrecursionlimit(10**9)
MOD = 10**9 + 7
N = int(eval(input()))
AB = [tuple(map(int, input().split())) for _ in range(N)]
AB.sort(key=lambda x: x[1])  # 締め切りが早い順位ソート
tmp = 0
for a, b in AB:
    if tmp + a <= b:
        tmp += a
    else:
        print("No")
        exit()
print("Yes")

+import sys + +input = sys.stdin.readline +sys.setrecursionlimit(10**9) +MOD = 10**9 + 7 -lst = [] -for _ in range(N): -    A, B = list(map(int, input().split())) -    lst += [[B, A]] -lst.sort() -t = 0 -for i in range(N): -    t += lst[i][1]  # 仕事に使う時間をプラス -    if t > lst[i][0]:  # 制限時間と比較 +AB = [tuple(map(int, input().split())) for _ in range(N)] +AB.sort(key=lambda x: x[1])  # 締め切りが早い順位ソート +tmp = 0 +for a, b in AB: +    if tmp + a <= b: +        tmp += a +    else: