from operator import itemgetter

N=int(eval(input()))

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

tasks.sort(key=itemgetter(1))

t=0

for w,l in tasks:

    if t+w>l:

        print('No')

        exit()

    t+=w

print('Yes')
import sys

def main():

    input = sys.stdin.readline

    N=int(eval(input()))

    tasks=[tuple(map(int, input().split())) for _ in range(N)]



    from operator import itemgetter

    tasks.sort(key=itemgetter(1))

    t=0

    for task in tasks:

        t += task[0]

        if t > task[1]:

            print('No')

            return

    print('Yes')



if __name__ == '__main__':

    main()
from operator import itemgetter

N = int(eval(input()))
tasks = [list(map(int, input().split())) for _ in range(N)]
tasks.sort(key=itemgetter(1))
t = 0
for w, l in tasks:
    if t + w > l:
        print("No")
        exit()
    t += w
print("Yes")

import sys


def main():
    input = sys.stdin.readline
    N = int(eval(input()))
    tasks = [tuple(map(int, input().split())) for _ in range(N)]
    from operator import itemgetter

    tasks.sort(key=itemgetter(1))
    t = 0
    for task in tasks:
        t += task[0]
        if t > task[1]:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    main()

-from operator import itemgetter +import sys -N = int(eval(input())) -tasks = [list(map(int, input().split())) for _ in range(N)] -tasks.sort(key=itemgetter(1)) -t = 0 -for w, l in tasks: -    if t + w > l: -        print("No") -        exit() -    t += w -print("Yes") + +def main(): +    input = sys.stdin.readline +    N = int(eval(input())) +    tasks = [tuple(map(int, input().split())) for _ in range(N)] +    from operator import itemgetter + +    tasks.sort(key=itemgetter(1)) +    t = 0 +    for task in tasks: +        t += task[0] +        if t > task[1]: +            print("No") +            return +    print("Yes") + + +if __name__ == "__main__": +    main()