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()

import sys

read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines



import numpy as np

def main():

    N = int(readline())

    tasks = np.array(read().split(), np.int64).reshape((-1, 2))

    tasks = tasks[np.argsort(tasks[..., 1]), ...]

    tasks[..., 0] = np.add.accumulate(tasks[..., 0], axis=0)

    tmp = tasks[..., 1]-tasks[..., 0]

    if np.all(tmp>=0):

        print('Yes')

    else:

        print('No')

if __name__ == '__main__':

    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()

import sys

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
import numpy as np


def main():
    N = int(readline())
    tasks = np.array(read().split(), np.int64).reshape((-1, 2))
    tasks = tasks[np.argsort(tasks[..., 1]), ...]
    tasks[..., 0] = np.add.accumulate(tasks[..., 0], axis=0)
    tmp = tasks[..., 1] - tasks[..., 0]
    if np.all(tmp >= 0):
        print("Yes")
    else:
        print("No")


if __name__ == "__main__":
    main()

-from operator import itemgetter +import numpy as np -    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") +    tasks = np.array(read().split(), np.int64).reshape((-1, 2)) +    tasks = tasks[np.argsort(tasks[..., 1]), ...] +    tasks[..., 0] = np.add.accumulate(tasks[..., 0], axis=0) +    tmp = tasks[..., 1] - tasks[..., 0] +    if np.all(tmp >= 0): +        print("Yes") +    else: +        print("No")