from operator import itemgetter



N = int(eval(input()))

AB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(1))



time = 0



for A, B in AB:

    if time + A <= B:

        time += A

    else:

        print('No')

        break

else:

    print('Yes')
from operator import itemgetter



N = int(eval(input()))



AB = []



for i in range(N):

    A, B = list(map(int, input().split()))

    AB.append((A, B))



AB = sorted(AB, key=itemgetter(1))



t = 0

ans = 'Yes'

for A, B in AB:

    if t + A > B:

        ans = 'No'

        break

    else: t += A

    

print(ans)
from operator import itemgetter

N = int(eval(input()))
AB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(1))
time = 0
for A, B in AB:
    if time + A <= B:
        time += A
    else:
        print("No")
        break
else:
    print("Yes")

from operator import itemgetter

N = int(eval(input()))
AB = []
for i in range(N):
    A, B = list(map(int, input().split()))
    AB.append((A, B))
AB = sorted(AB, key=itemgetter(1))
t = 0
ans = "Yes"
for A, B in AB:
    if t + A > B:
        ans = "No"
        break
    else:
        t += A
print(ans)

-AB = sorted([list(map(int, input().split())) for i in range(N)], key=itemgetter(1)) -time = 0 +AB = [] +for i in range(N): +    A, B = list(map(int, input().split())) +    AB.append((A, B)) +AB = sorted(AB, key=itemgetter(1)) +t = 0 +ans = "Yes" -    if time + A <= B: -        time += A +    if t + A > B: +        ans = "No" +        break -        print("No") -        break -else: -    print("Yes") +        t += A +print(ans)