n=int(eval(input()))

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



AB.sort(key=lambda x:(x[1],x[0]))

time=0

for a,b in AB:

  if time+a>b:

    print('No')

    exit()

  time+=a

print('Yes')
import sys

input = sys.stdin.readline

n=int(eval(input()))

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



AB.sort(key=lambda x:(x[1],x[0]))

time=0

for a,b in AB:

  if time+a>b:

    print('No')

    exit()

  time+=a

print('Yes')
n = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(key=lambda x: (x[1], x[0]))
time = 0
for a, b in AB:
    if time + a > b:
        print("No")
        exit()
    time += a
print("Yes")

import sys

input = sys.stdin.readline
n = int(eval(input()))
AB = [list(map(int, input().split())) for _ in range(n)]
AB.sort(key=lambda x: (x[1], x[0]))
time = 0
for a, b in AB:
    if time + a > b:
        print("No")
        exit()
    time += a
print("Yes")

+import sys + +input = sys.stdin.readline