n=int(eval(input()))

time=0

tasks=[]

for i in range(n):

  tasks.append(list(map(int,input().split())))

tasks.sort(key=lambda x:x[1])

flag=0

for i in range(n):

  time+=tasks[i][0]

  if time>tasks[i][1]:

    flag=1

    break

if flag==0:

  print("Yes")

else:

  print("No")
import sys

input= sys.stdin.readline

n=int(eval(input()))

time=0

tasks=[]

for i in range(n):

  tasks.append(list(map(int,input().split())))

tasks.sort(key=lambda x:x[1])

flag=0

for i in range(n):

  time+=tasks[i][0]

  if time>tasks[i][1]:

    flag=1

    break

if flag==0:

  print("Yes")

else:

  print("No")

n = int(eval(input()))
time = 0
tasks = []
for i in range(n):
    tasks.append(list(map(int, input().split())))
tasks.sort(key=lambda x: x[1])
flag = 0
for i in range(n):
    time += tasks[i][0]
    if time > tasks[i][1]:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

import sys

input = sys.stdin.readline
n = int(eval(input()))
time = 0
tasks = []
for i in range(n):
    tasks.append(list(map(int, input().split())))
tasks.sort(key=lambda x: x[1])
flag = 0
for i in range(n):
    time += tasks[i][0]
    if time > tasks[i][1]:
        flag = 1
        break
if flag == 0:
    print("Yes")
else:
    print("No")

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