N = int(eval(input()))

AB = []



for i in range(N):

  AB.append(list(map(int, input().split())))



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



time = 0

possibility = 1



for l in AB:

  if l[0] + time > l[1]:

    possibility = 0

    break

  else:

    time += l[0]

    

if possibility == 1:

  print("Yes")

else:

  print("No")
import sys

input = sys.stdin.readline

N = int(eval(input()))

a = []

for _ in range(N):

  l, r = list(map(int, input().split()))

  a.append((l, r))

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

p = 0

for i in range(N):

  if p <= a[i][1] - a[i][0]: p += a[i][0]

  else:

    print("No")

    exit(0)

print("Yes")
N = int(eval(input()))
AB = []
for i in range(N):
    AB.append(list(map(int, input().split())))
AB.sort(key=lambda x: x[1])
time = 0
possibility = 1
for l in AB:
    if l[0] + time > l[1]:
        possibility = 0
        break
    else:
        time += l[0]
if possibility == 1:
    print("Yes")
else:
    print("No")

import sys

input = sys.stdin.readline
N = int(eval(input()))
a = []
for _ in range(N):
    l, r = list(map(int, input().split()))
    a.append((l, r))
a.sort(key=lambda x: x[1])
p = 0
for i in range(N):
    if p <= a[i][1] - a[i][0]:
        p += a[i][0]
    else:
        print("No")
        exit(0)
print("Yes")

+import sys + +input = sys.stdin.readline -AB = [] +a = [] +for _ in range(N): +    l, r = list(map(int, input().split())) +    a.append((l, r)) +a.sort(key=lambda x: x[1]) +p = 0 -    AB.append(list(map(int, input().split()))) -AB.sort(key=lambda x: x[1]) -time = 0 -possibility = 1 -for l in AB: -    if l[0] + time > l[1]: -        possibility = 0 -        break +    if p <= a[i][1] - a[i][0]: +        p += a[i][0] -        time += l[0] -if possibility == 1: -    print("Yes") -else: -    print("No") +        print("No") +        exit(0) +print("Yes")