def solve(n: int, ab: 'list(Task)') -> bool:

    from operator import attrgetter

    ab.sort(key=attrgetter('limit'))

    cur = 0

    for ab_ in ab:

        cur += ab_.cost

        if cur > ab_.limit:

            return False

    return True





if __name__ == '__main__':

    from collections import namedtuple

    import sys



    input = sys.stdin.readline

    Task = namedtuple('Task', 'cost limit')

    n = int(eval(input()))

    ab = []

    for _ in range(n):

        cost_, limit_ = list(map(int, input().split()))

        ab.append(Task(cost=cost_, limit=limit_))

    print(('Yes' if solve(n, ab) else 'No'))

def main():

    from operator import itemgetter

    import sys

    input = sys.stdin.readline



    N = int(eval(input()))



    tasks = []

    for _ in range(N):

        tasks.append(tuple(map(int, input().split())))  # (A,B)

    tasks.sort(key=itemgetter(1))



    t = 0

    cond = True

    for a, b in tasks:

        t += a

        if t > b:

            cond = False

            break



    print(('Yes' if cond else 'No'))





if __name__ == '__main__':

    main()

def solve(n: int, ab: "list(Task)") -> bool:
    from operator import attrgetter

    ab.sort(key=attrgetter("limit"))
    cur = 0
    for ab_ in ab:
        cur += ab_.cost
        if cur > ab_.limit:
            return False
    return True


if __name__ == "__main__":
    from collections import namedtuple
    import sys

    input = sys.stdin.readline
    Task = namedtuple("Task", "cost limit")
    n = int(eval(input()))
    ab = []
    for _ in range(n):
        cost_, limit_ = list(map(int, input().split()))
        ab.append(Task(cost=cost_, limit=limit_))
    print(("Yes" if solve(n, ab) else "No"))

def main():
    from operator import itemgetter
    import sys

    input = sys.stdin.readline
    N = int(eval(input()))
    tasks = []
    for _ in range(N):
        tasks.append(tuple(map(int, input().split())))  # (A,B)
    tasks.sort(key=itemgetter(1))
    t = 0
    cond = True
    for a, b in tasks:
        t += a
        if t > b:
            cond = False
            break
    print(("Yes" if cond else "No"))


if __name__ == "__main__":
    main()

-def solve(n: int, ab: "list(Task)") -> bool: -    from operator import attrgetter +def main(): +    from operator import itemgetter +    import sys -    ab.sort(key=attrgetter("limit")) -    cur = 0 -    for ab_ in ab: -        cur += ab_.cost -        if cur > ab_.limit: -            return False -    return True +    input = sys.stdin.readline +    N = int(eval(input())) +    tasks = [] +    for _ in range(N): +        tasks.append(tuple(map(int, input().split())))  # (A,B) +    tasks.sort(key=itemgetter(1)) +    t = 0 +    cond = True +    for a, b in tasks: +        t += a +        if t > b: +            cond = False +            break +    print(("Yes" if cond else "No")) -    from collections import namedtuple -    import sys - -    input = sys.stdin.readline -    Task = namedtuple("Task", "cost limit") -    n = int(eval(input())) -    ab = [] -    for _ in range(n): -        cost_, limit_ = list(map(int, input().split())) -        ab.append(Task(cost=cost_, limit=limit_)) -    print(("Yes" if solve(n, ab) else "No")) +    main()