a = [int(eval(input())) for i in range(1)]

n = a[0]

works = [list(map(int, input().split())) for i in range(n)]

#print(works)  

works = sorted(works, key=lambda x: x[1])

work_time = 0

for w in works:

  work_time += w[0]

  if work_time > w[1]:

    print("No")

    break

else:

  print("Yes")

import sys



sr = lambda: sys.stdin.readline().rstrip()

ir = lambda: int(sr())

lr = lambda: list(map(int, sr().split()))



N = ir()

AB = [lr() for _ in range(N)]

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

answer = 'Yes'

time = 0

for i in range(N):

    if time + AB[i][0] > AB[i][1]:

        answer = 'No'

    time += AB[i][0]



print(answer)

a = [int(eval(input())) for i in range(1)]
n = a[0]
works = [list(map(int, input().split())) for i in range(n)]
# print(works)
works = sorted(works, key=lambda x: x[1])
work_time = 0
for w in works:
    work_time += w[0]
    if work_time > w[1]:
        print("No")
        break
else:
    print("Yes")

import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))
N = ir()
AB = [lr() for _ in range(N)]
AB.sort(key=lambda x: x[1])
answer = "Yes"
time = 0
for i in range(N):
    if time + AB[i][0] > AB[i][1]:
        answer = "No"
    time += AB[i][0]
print(answer)

-a = [int(eval(input())) for i in range(1)] -n = a[0] -works = [list(map(int, input().split())) for i in range(n)] -# print(works) -works = sorted(works, key=lambda x: x[1]) -work_time = 0 -for w in works: -    work_time += w[0] -    if work_time > w[1]: -        print("No") -        break -else: -    print("Yes") +import sys + +sr = lambda: sys.stdin.readline().rstrip() +ir = lambda: int(sr()) +lr = lambda: list(map(int, sr().split())) +N = ir() +AB = [lr() for _ in range(N)] +AB.sort(key=lambda x: x[1]) +answer = "Yes" +time = 0 +for i in range(N): +    if time + AB[i][0] > AB[i][1]: +        answer = "No" +    time += AB[i][0] +print(answer)