from collections import deque

N = int(eval(input()))

A = deque()

for _ in range(N):

    a,b = list(map(int,input().split()))

    A.append([b,a])

A = list(A)

A.sort()

time = 0

for i in A:

    time += i[1]

    if time > i[0]:

        print('No')

        exit()

print('Yes')
import sys

import math

import itertools

import bisect

from copy import copy

from collections import deque,Counter

from decimal import Decimal

def s(): return eval(input())

def i(): return int(eval(input()))

def S(): return input().split()

def I(): return list(map(int,input().split()))

def L(): return list(map(int,input().split()))

def l(): return list(map(int,input().split()))

def lcm(a,b): return a*b//math.gcd(a,b)

sys.setrecursionlimit(10 ** 9)

INF = 10**9

mod = 10**9+7



N = i()

L = []

for i in range(N):

    A,B = I()

    L.append([B,A])

L.sort()

cnt = 0

for i in range(N):

    cnt += L[i][1]

    if cnt > L[i][0]:

        print('No')

        exit()

print('Yes')
from collections import deque

N = int(eval(input()))
A = deque()
for _ in range(N):
    a, b = list(map(int, input().split()))
    A.append([b, a])
A = list(A)
A.sort()
time = 0
for i in A:
    time += i[1]
    if time > i[0]:
        print("No")
        exit()
print("Yes")

import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque, Counter
from decimal import Decimal


def s():
    return eval(input())


def i():
    return int(eval(input()))


def S():
    return input().split()


def I():
    return list(map(int, input().split()))


def L():
    return list(map(int, input().split()))


def l():
    return list(map(int, input().split()))


def lcm(a, b):
    return a * b // math.gcd(a, b)


sys.setrecursionlimit(10**9)
INF = 10**9
mod = 10**9 + 7
N = i()
L = []
for i in range(N):
    A, B = I()
    L.append([B, A])
L.sort()
cnt = 0
for i in range(N):
    cnt += L[i][1]
    if cnt > L[i][0]:
        print("No")
        exit()
print("Yes")

-from collections import deque +import sys +import math +import itertools +import bisect +from copy import copy +from collections import deque, Counter +from decimal import Decimal -N = int(eval(input())) -A = deque() -for _ in range(N): -    a, b = list(map(int, input().split())) -    A.append([b, a]) -A = list(A) -A.sort() -time = 0 -for i in A: -    time += i[1] -    if time > i[0]: + +def s(): +    return eval(input()) + + +def i(): +    return int(eval(input())) + + +def S(): +    return input().split() + + +def I(): +    return list(map(int, input().split())) + + +def L(): +    return list(map(int, input().split())) + + +def l(): +    return list(map(int, input().split())) + + +def lcm(a, b): +    return a * b // math.gcd(a, b) + + +sys.setrecursionlimit(10**9) +INF = 10**9 +mod = 10**9 + 7 +N = i() +L = [] +for i in range(N): +    A, B = I() +    L.append([B, A]) +L.sort() +cnt = 0 +for i in range(N): +    cnt += L[i][1] +    if cnt > L[i][0]: