import sys

from operator import itemgetter





def solve(tasks):

    tasks.sort(key=itemgetter(1))

    t = 0

    for a, b in tasks:

        t += a

        if t > b:

            return False

    return True





n = int(eval(input()))

tasks = [tuple(map(int, line.split())) for line in sys.stdin]

print(('Yes' if solve(tasks) else 'No'))

import sys

import numpy as np



n = int(eval(input()))

a, b = np.fromstring(sys.stdin.read(), sep=' ').reshape((n, 2)).T

i = b.argsort()

print(('Yes' if (a[i].cumsum() <= b[i]).all() else 'No'))

import sys
from operator import itemgetter


def solve(tasks):
    tasks.sort(key=itemgetter(1))
    t = 0
    for a, b in tasks:
        t += a
        if t > b:
            return False
    return True


n = int(eval(input()))
tasks = [tuple(map(int, line.split())) for line in sys.stdin]
print(("Yes" if solve(tasks) else "No"))

import sys
import numpy as np

n = int(eval(input()))
a, b = np.fromstring(sys.stdin.read(), sep=" ").reshape((n, 2)).T
i = b.argsort()
print(("Yes" if (a[i].cumsum() <= b[i]).all() else "No"))

-from operator import itemgetter - - -def solve(tasks): -    tasks.sort(key=itemgetter(1)) -    t = 0 -    for a, b in tasks: -        t += a -        if t > b: -            return False -    return True - +import numpy as np -tasks = [tuple(map(int, line.split())) for line in sys.stdin] -print(("Yes" if solve(tasks) else "No")) +a, b = np.fromstring(sys.stdin.read(), sep=" ").reshape((n, 2)).T +i = b.argsort() +print(("Yes" if (a[i].cumsum() <= b[i]).all() else "No"))