import sys

input = lambda: sys.stdin.readline()[:-1]

n=int(eval(input()))

data=[tuple(map(int,input().split())) for i in range(n)]

data.sort(key=lambda tup:tup[1])

time=0

for offer in data:

	time+=offer[0]

	if time > offer[1]:

		print('No')

		break

else:print('Yes')

#!/usr/bin/env python3

import sys

input = lambda: sys.stdin.readline()[:-1]

sys.setrecursionlimit(10**8)



n=int(eval(input()))

ab=[]

for i in range(n):

    ab.append(tuple(map(int,input().split())))

ab.sort(key=lambda tup:tup[1])

time=0

for a,b in ab:

    time+=a

    if time>b:

        print('No')

        exit()

print('Yes')
import sys

input = lambda: sys.stdin.readline()[:-1]
n = int(eval(input()))
data = [tuple(map(int, input().split())) for i in range(n)]
data.sort(key=lambda tup: tup[1])
time = 0
for offer in data:
    time += offer[0]
    if time > offer[1]:
        print("No")
        break
else:
    print("Yes")

#!/usr/bin/env python3
import sys

input = lambda: sys.stdin.readline()[:-1]
sys.setrecursionlimit(10**8)
n = int(eval(input()))
ab = []
for i in range(n):
    ab.append(tuple(map(int, input().split())))
ab.sort(key=lambda tup: tup[1])
time = 0
for a, b in ab:
    time += a
    if time > b:
        print("No")
        exit()
print("Yes")

+#!/usr/bin/env python3 +sys.setrecursionlimit(10**8) -data = [tuple(map(int, input().split())) for i in range(n)] -data.sort(key=lambda tup: tup[1]) +ab = [] +for i in range(n): +    ab.append(tuple(map(int, input().split()))) +ab.sort(key=lambda tup: tup[1]) -for offer in data: -    time += offer[0] -    if time > offer[1]: +for a, b in ab: +    time += a +    if time > b: -        break -else: -    print("Yes") +        exit() +print("Yes")