# ABC131D - Megalomania

import sys

input = sys.stdin.readline



from itertools import accumulate





def main():

    N = int(eval(input()))

    A = sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1])

    T, D = list(zip(*A))  # tasks, deadlines

    T = list(accumulate(T))

    flg = all(t <= d for t, d in zip(T, D))  # all tasks finish within each deadline?

    print(("Yes" if flg else "No"))





if __name__ == "__main__":

    main()
# ABC131D - Megalomania

import sys

input = sys.stdin.readline



from operator import itemgetter as get



def main():

    N = int(eval(input()))

    A = sorted(

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

    )

    cur = 0

    for task, deadline in A:  # check all tasks greedily

        cur += task

        if cur > deadline:  # fail to finish a task within its deadline

            print("No")

            break

    else:

        print("Yes")





if __name__ == "__main__":

    main()
# ABC131D - Megalomania
import sys

input = sys.stdin.readline
from itertools import accumulate


def main():
    N = int(eval(input()))
    A = sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1])
    T, D = list(zip(*A))  # tasks, deadlines
    T = list(accumulate(T))
    flg = all(t <= d for t, d in zip(T, D))  # all tasks finish within each deadline?
    print(("Yes" if flg else "No"))


if __name__ == "__main__":
    main()

# ABC131D - Megalomania
import sys

input = sys.stdin.readline
from operator import itemgetter as get


def main():
    N = int(eval(input()))
    A = sorted([tuple(map(int, input().split())) for _ in range(N)], key=get(1))
    cur = 0
    for task, deadline in A:  # check all tasks greedily
        cur += task
        if cur > deadline:  # fail to finish a task within its deadline
            print("No")
            break
    else:
        print("Yes")


if __name__ == "__main__":
    main()

-from itertools import accumulate +from operator import itemgetter as get -    A = sorted([tuple(map(int, input().split())) for _ in range(N)], key=lambda x: x[1]) -    T, D = list(zip(*A))  # tasks, deadlines -    T = list(accumulate(T)) -    flg = all(t <= d for t, d in zip(T, D))  # all tasks finish within each deadline? -    print(("Yes" if flg else "No")) +    A = sorted([tuple(map(int, input().split())) for _ in range(N)], key=get(1)) +    cur = 0 +    for task, deadline in A:  # check all tasks greedily +        cur += task +        if cur > deadline:  # fail to finish a task within its deadline +            print("No") +            break +    else: +        print("Yes")