# 131 D - Megalomania

N = int(eval(input()))

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



from operator import itemgetter

AB = sorted(AB, key=itemgetter(1))



rt = 'Yes'

X = []

val = 0

for i in range(N):

    val += AB[i][0]

    X.append( [val, AB[i][1]] )

    if val > AB[i][1] :

        rt = 'No'

        break

print(rt)
# 131 D - Megalomania

N = int(eval(input()))

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



from operator import itemgetter

AB = sorted(AB, key=itemgetter(1))



rt = 'Yes'

val = 0

for i in range(N):

    val += AB[i][0]

    if val > AB[i][1] :

        rt = 'No'

        break

print(rt)

# 131 D - Megalomania
N = int(eval(input()))
AB = [list(map(int, input().split())) for i in range(N)]
from operator import itemgetter

AB = sorted(AB, key=itemgetter(1))
rt = "Yes"
X = []
val = 0
for i in range(N):
    val += AB[i][0]
    X.append([val, AB[i][1]])
    if val > AB[i][1]:
        rt = "No"
        break
print(rt)

# 131 D - Megalomania
N = int(eval(input()))
AB = [list(map(int, input().split())) for i in range(N)]
from operator import itemgetter

AB = sorted(AB, key=itemgetter(1))
rt = "Yes"
val = 0
for i in range(N):
    val += AB[i][0]
    if val > AB[i][1]:
        rt = "No"
        break
print(rt)

-X = [] -    X.append([val, AB[i][1]])