import sys

stdin = sys.stdin



sys.setrecursionlimit(10 ** 7)



def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



n = ni()

ab = [list(li()) for _ in range(n)]



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



cur = 0



ans = True



for ai, bi in ab:

    cur += ai

    if cur > bi:

        ans = False



print(("Yes" if ans else "No"))
import sys

stdin = sys.stdin



sys.setrecursionlimit(10 ** 7)



def li(): return list(map(int, stdin.readline().split()))

def li_(): return [int(x) - 1 for x in stdin.readline().split()]

def lf(): return list(map(float, stdin.readline().split()))

def ls(): return stdin.readline().split()

def ns(): return stdin.readline().rstrip()

def lc(): return list(ns())

def ni(): return int(stdin.readline())

def nf(): return float(stdin.readline())



n = ni()

ab = [tuple(li()) for _ in range(n)]



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

cur = 0

ok = True



for ai, bi in ab:

    cur += ai

    if cur > bi:

        ok = False

        break



print(("Yes" if ok else "No"))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


n = ni()
ab = [list(li()) for _ in range(n)]
ab.sort(key=lambda x: x[1])
cur = 0
ans = True
for ai, bi in ab:
    cur += ai
    if cur > bi:
        ans = False
print(("Yes" if ans else "No"))

import sys

stdin = sys.stdin
sys.setrecursionlimit(10**7)


def li():
    return list(map(int, stdin.readline().split()))


def li_():
    return [int(x) - 1 for x in stdin.readline().split()]


def lf():
    return list(map(float, stdin.readline().split()))


def ls():
    return stdin.readline().split()


def ns():
    return stdin.readline().rstrip()


def lc():
    return list(ns())


def ni():
    return int(stdin.readline())


def nf():
    return float(stdin.readline())


n = ni()
ab = [tuple(li()) for _ in range(n)]
ab.sort(key=lambda x: x[1])
cur = 0
ok = True
for ai, bi in ab:
    cur += ai
    if cur > bi:
        ok = False
        break
print(("Yes" if ok else "No"))

-ab = [list(li()) for _ in range(n)] +ab = [tuple(li()) for _ in range(n)] -ans = True +ok = True -        ans = False -print(("Yes" if ans else "No")) +        ok = False +        break +print(("Yes" if ok else "No"))