#python3

from operator import itemgetter 

from itertools import accumulate

def main():

    n = int(eval(input()))

    d = []

    for _ in range(n):

        x, y = list(map(int, input().split()))

        d.append((x, y))

    d.sort(key=itemgetter(1))

    acc = 0

    f = True

    for i in range(n):

        acc = acc+d[i][0] 

        if acc > d[i][1]:

            f = False

    if f:

        print('Yes')

    else:

        print('No')

main()

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



from operator import itemgetter 

def main():

    N = int(readline())

    tasks = []

    for _ in range(N):

        a, b = list(map(int, readline().split()))

        tasks.append((a, b))

    tasks.sort(key=itemgetter(1))

    time = 0

    for a, b in tasks:

        time += a

        if time > b:

            print('No')

            return  

    print('Yes')

if __name__ == '__main__':

    main()

# python3
from operator import itemgetter
from itertools import accumulate


def main():
    n = int(eval(input()))
    d = []
    for _ in range(n):
        x, y = list(map(int, input().split()))
        d.append((x, y))
    d.sort(key=itemgetter(1))
    acc = 0
    f = True
    for i in range(n):
        acc = acc + d[i][0]
        if acc > d[i][1]:
            f = False
    if f:
        print("Yes")
    else:
        print("No")


main()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from operator import itemgetter


def main():
    N = int(readline())
    tasks = []
    for _ in range(N):
        a, b = list(map(int, readline().split()))
        tasks.append((a, b))
    tasks.sort(key=itemgetter(1))
    time = 0
    for a, b in tasks:
        time += a
        if time > b:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    main()

-# python3 +import sys + +read = sys.stdin.buffer.read +readline = sys.stdin.buffer.readline +readlines = sys.stdin.buffer.readlines -from itertools import accumulate -    n = int(eval(input())) -    d = [] -    for _ in range(n): -        x, y = list(map(int, input().split())) -        d.append((x, y)) -    d.sort(key=itemgetter(1)) -    acc = 0 -    f = True -    for i in range(n): -        acc = acc + d[i][0] -        if acc > d[i][1]: -            f = False -    if f: -        print("Yes") -    else: -        print("No") +    N = int(readline()) +    tasks = [] +    for _ in range(N): +        a, b = list(map(int, readline().split())) +        tasks.append((a, b)) +    tasks.sort(key=itemgetter(1)) +    time = 0 +    for a, b in tasks: +        time += a +        if time > b: +            print("No") +            return +    print("Yes") -main() +if __name__ == "__main__": +    main()