def main():

    n = int(eval(input()))

    abl = []

    for _ in range(n):

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

        abl.append([a,b])



    abl.sort(key=lambda x:x[1])

    curr_time = 0

    for curr_ab in abl:

        # print(curr_time)

        a,b = curr_ab

        curr_time += a

        if curr_time > b:

            print('No')

            return

    print('Yes')





if __name__ == "__main__":

    main()
n = int(eval(input()))

abl = []

for _ in range(n):

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

    abl.append((b,a))



abl.sort()

curr = 0

for b,a in abl:

    curr += a

    if curr > b:

        print('No')

        break

else:

    print('Yes')
def main():
    n = int(eval(input()))
    abl = []
    for _ in range(n):
        a, b = list(map(int, input().split()))
        abl.append([a, b])
    abl.sort(key=lambda x: x[1])
    curr_time = 0
    for curr_ab in abl:
        # print(curr_time)
        a, b = curr_ab
        curr_time += a
        if curr_time > b:
            print("No")
            return
    print("Yes")


if __name__ == "__main__":
    main()

n = int(eval(input()))
abl = []
for _ in range(n):
    a, b = list(map(int, input().split()))
    abl.append((b, a))
abl.sort()
curr = 0
for b, a in abl:
    curr += a
    if curr > b:
        print("No")
        break
else:
    print("Yes")

-def main(): -    n = int(eval(input())) -    abl = [] -    for _ in range(n): -        a, b = list(map(int, input().split())) -        abl.append([a, b]) -    abl.sort(key=lambda x: x[1]) -    curr_time = 0 -    for curr_ab in abl: -        # print(curr_time) -        a, b = curr_ab -        curr_time += a -        if curr_time > b: -            print("No") -            return +n = int(eval(input())) +abl = [] +for _ in range(n): +    a, b = list(map(int, input().split())) +    abl.append((b, a)) +abl.sort() +curr = 0 +for b, a in abl: +    curr += a +    if curr > b: +        print("No") +        break +else: - - -if __name__ == "__main__": -    main()