def doit(ab):

    ab = sorted(ab, key=lambda x: (x[1], x[0]))

    s = 0

    for a, b in ab:

        s += a

        if s > b:

            return "No"

    return "Yes"



n = int(eval(input()))

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

print((doit(ab)))

def ok(ab):

    t = 0

    for a, b in ab:

        t += a

        if t > b:

            return False

    return True



n = int(eval(input()))

print(('Yes' if ok(sorted([list(map(int, input().split())) for _ in range(n)], key=lambda ab: ab[1])) else 'No'))
def doit(ab):
    ab = sorted(ab, key=lambda x: (x[1], x[0]))
    s = 0
    for a, b in ab:
        s += a
        if s > b:
            return "No"
    return "Yes"


n = int(eval(input()))
ab = [list(map(int, input().split())) for _ in range(n)]
print((doit(ab)))

def ok(ab):
    t = 0
    for a, b in ab:
        t += a
        if t > b:
            return False
    return True


n = int(eval(input()))
print(
    (
        "Yes"
        if ok(
            sorted(
                [list(map(int, input().split())) for _ in range(n)],
                key=lambda ab: ab[1],
            )
        )
        else "No"
    )
)

-def doit(ab): -    ab = sorted(ab, key=lambda x: (x[1], x[0])) -    s = 0 +def ok(ab): +    t = 0 -        s += a -        if s > b: -            return "No" -    return "Yes" +        t += a +        if t > b: +            return False +    return True -ab = [list(map(int, input().split())) for _ in range(n)] -print((doit(ab))) +print( +    ( +        "Yes" +        if ok( +            sorted( +                [list(map(int, input().split())) for _ in range(n)], +                key=lambda ab: ab[1], +            ) +        ) +        else "No" +    ) +)